Skip to content

Commit aff98f5

Browse files
committed
wms provider: recover the possibility to configure the feature count in WMS requests
(cherry picked from commit 1dfe005)
1 parent 1076f70 commit aff98f5

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

src/providers/wms/qgswmscapabilities.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,18 @@ bool QgsWmsCapabilities::shouldInvertAxisOrientation( const QString& ogcCrs )
18381838
return changeXY;
18391839
}
18401840

1841+
int QgsWmsCapabilities::identifyCapabilities() const
1842+
{
1843+
int capability = QgsRasterInterface::NoCapabilities;
1844+
1845+
foreach ( QgsRaster::IdentifyFormat f, mIdentifyFormats.keys() )
1846+
{
1847+
capability |= QgsRasterDataProvider::identifyFormatToCapability( f );
1848+
}
1849+
1850+
return capability;
1851+
}
1852+
18411853

18421854

18431855
// -----------------

src/providers/wms/qgswmscapabilities.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ class QgsWmsSettings
530530
};
531531

532532

533-
/** keeps information about capabilities of particular URI */
533+
/** Keeps information about capabilities of particular URI */
534534
class QgsWmsCapabilities
535535
{
536536
public:
@@ -577,6 +577,9 @@ class QgsWmsCapabilities
577577
/** Find out whether to invert axis orientation when parsing/writing coordinates */
578578
bool shouldInvertAxisOrientation( const QString& ogcCrs );
579579

580+
/** Find out identify capabilities */
581+
int identifyCapabilities() const;
582+
580583
protected:
581584
bool parseCapabilitiesDom( QByteArray const &xml, QgsWmsCapabilitiesProperty& capabilitiesProperty );
582585

@@ -674,7 +677,7 @@ class QgsWmsCapabilities
674677

675678

676679

677-
/** class that handles download of capabilities */
680+
/** Class that handles download of capabilities */
678681
class QgsWmsCapabilitiesDownload : public QObject
679682
{
680683
Q_OBJECT

src/providers/wms/qgswmsprovider.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ int QgsWmsProvider::capabilities() const
13231323

13241324
if ( canIdentify )
13251325
{
1326-
capability = identifyCapabilities();
1326+
capability = mCaps.identifyCapabilities();
13271327
if ( capability )
13281328
{
13291329
capability |= Identify;
@@ -1334,19 +1334,6 @@ int QgsWmsProvider::capabilities() const
13341334
return capability;
13351335
}
13361336

1337-
int QgsWmsProvider::identifyCapabilities() const
1338-
{
1339-
int capability = NoCapabilities;
1340-
1341-
foreach ( QgsRaster::IdentifyFormat f, mCaps.mIdentifyFormats.keys() )
1342-
{
1343-
capability |= identifyFormatToCapability( f );
1344-
}
1345-
1346-
QgsDebugMsg( QString( "capability = %1" ).arg( capability ) );
1347-
return capability;
1348-
}
1349-
13501337
QString QgsWmsProvider::layerMetadata( QgsWmsLayerProperty &layer )
13511338
{
13521339
QString metadata;

src/providers/wms/qgswmsprovider.h

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
128128
QgsRasterInterface * clone() const override;
129129

130130

131-
/*! Get the QgsCoordinateReferenceSystem for this layer
131+
/** Get the QgsCoordinateReferenceSystem for this layer
132132
* @note Must be reimplemented by each provider.
133133
* If the provider isn't capable of returning
134134
* its projection an empty srs will be return, ti will return 0
@@ -176,26 +176,26 @@ class QgsWmsProvider : public QgsRasterDataProvider
176176
*/
177177
virtual QgsRectangle extent() override;
178178

179-
/**Returns true if layer is valid
179+
/** Returns true if layer is valid
180180
*/
181181
bool isValid() override;
182182

183183
#if 0
184-
/**Returns true if layer has tile set profiles
184+
/** Returns true if layer has tile set profiles
185185
*/
186186
virtual bool hasTiles() const;
187187
#endif
188188

189-
/**Returns the GetMap url */
189+
/** Returns the GetMap url */
190190
virtual QString getMapUrl() const;
191191

192-
/**Returns the GetFeatureInfo url */
192+
/** Returns the GetFeatureInfo url */
193193
virtual QString getFeatureInfoUrl() const;
194194

195-
/**Return the GetTile url */
195+
/** Return the GetTile url */
196196
virtual QString getTileUrl() const;
197197

198-
/**Return the GetLegendGraphic url
198+
/** Return the GetLegendGraphic url
199199
* @added in 2.1
200200
*/
201201
virtual QString getLegendGraphicUrl() const;
@@ -265,9 +265,6 @@ class QgsWmsProvider : public QgsRasterDataProvider
265265
*/
266266
int capabilities() const override;
267267

268-
/** Server identify capabilities, used by source select. */
269-
int identifyCapabilities() const;
270-
271268
QGis::DataType dataType( int bandNo ) const override;
272269
QGis::DataType srcDataType( int bandNo ) const override;
273270
int bandCount() const override;
@@ -305,7 +302,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
305302
*/
306303
QString lastErrorFormat() override;
307304

308-
/** return a provider name
305+
/** Return a provider name
309306
310307
Essentially just returns the provider key. Should be used to build file
311308
dialogs so that providers can be shown with their supported types. Thus
@@ -322,7 +319,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
322319
QString name() const override;
323320

324321

325-
/** return description
322+
/** Return description
326323
327324
Return a terse string describing what the provider is.
328325
@@ -335,7 +332,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
335332
*/
336333
QString description() const override;
337334

338-
/**Reloads the data from the source. Needs to be implemented by providers with data caches to
335+
/** Reloads the data from the source. Needs to be implemented by providers with data caches to
339336
synchronize with changes in the data source*/
340337
virtual void reloadData() override;
341338

@@ -433,7 +430,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
433430

434431
private:
435432

436-
/**Return the full url to request legend graphic
433+
/** Return the full url to request legend graphic
437434
* The visibleExtent isi only used if provider supports contextual
438435
* legends according to the QgsWmsSettings
439436
* @added in 2.8

src/providers/wms/qgswmssourceselect.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ void QgsWMSSourceSelect::on_btnConnect_clicked()
475475
return;
476476
}
477477

478+
mFeatureCount->setEnabled( caps.identifyCapabilities() != QgsRasterInterface::NoCapabilities );
479+
478480
populateLayerList( caps );
479481
}
480482

0 commit comments

Comments
 (0)