Skip to content
Permalink
Browse files

wms provider: recover the possibility to configure the feature count …

…in WMS requests

(cherry picked from commit 1dfe005)
  • Loading branch information
jef-n committed Jun 30, 2015
1 parent 1076f70 commit aff98f5347b37789838f1dda4d551d4524381044
@@ -1838,6 +1838,18 @@ bool QgsWmsCapabilities::shouldInvertAxisOrientation( const QString& ogcCrs )
return changeXY;
}

int QgsWmsCapabilities::identifyCapabilities() const
{
int capability = QgsRasterInterface::NoCapabilities;

foreach ( QgsRaster::IdentifyFormat f, mIdentifyFormats.keys() )
{
capability |= QgsRasterDataProvider::identifyFormatToCapability( f );
}

return capability;
}



// -----------------
@@ -530,7 +530,7 @@ class QgsWmsSettings
};


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

/** Find out identify capabilities */
int identifyCapabilities() const;

protected:
bool parseCapabilitiesDom( QByteArray const &xml, QgsWmsCapabilitiesProperty& capabilitiesProperty );

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



/** class that handles download of capabilities */
/** Class that handles download of capabilities */
class QgsWmsCapabilitiesDownload : public QObject
{
Q_OBJECT
@@ -1323,7 +1323,7 @@ int QgsWmsProvider::capabilities() const

if ( canIdentify )
{
capability = identifyCapabilities();
capability = mCaps.identifyCapabilities();
if ( capability )
{
capability |= Identify;
@@ -1334,19 +1334,6 @@ int QgsWmsProvider::capabilities() const
return capability;
}

int QgsWmsProvider::identifyCapabilities() const
{
int capability = NoCapabilities;

foreach ( QgsRaster::IdentifyFormat f, mCaps.mIdentifyFormats.keys() )
{
capability |= identifyFormatToCapability( f );
}

QgsDebugMsg( QString( "capability = %1" ).arg( capability ) );
return capability;
}

QString QgsWmsProvider::layerMetadata( QgsWmsLayerProperty &layer )
{
QString metadata;
@@ -128,7 +128,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
QgsRasterInterface * clone() const override;


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

/**Returns true if layer is valid
/** Returns true if layer is valid
*/
bool isValid() override;

#if 0
/**Returns true if layer has tile set profiles
/** Returns true if layer has tile set profiles
*/
virtual bool hasTiles() const;
#endif

/**Returns the GetMap url */
/** Returns the GetMap url */
virtual QString getMapUrl() const;

/**Returns the GetFeatureInfo url */
/** Returns the GetFeatureInfo url */
virtual QString getFeatureInfoUrl() const;

/**Return the GetTile url */
/** Return the GetTile url */
virtual QString getTileUrl() const;

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

/** Server identify capabilities, used by source select. */
int identifyCapabilities() const;

QGis::DataType dataType( int bandNo ) const override;
QGis::DataType srcDataType( int bandNo ) const override;
int bandCount() const override;
@@ -305,7 +302,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
*/
QString lastErrorFormat() override;

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


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

/**Reloads the data from the source. Needs to be implemented by providers with data caches to
/** Reloads the data from the source. Needs to be implemented by providers with data caches to
synchronize with changes in the data source*/
virtual void reloadData() override;

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

private:

/**Return the full url to request legend graphic
/** Return the full url to request legend graphic
* The visibleExtent isi only used if provider supports contextual
* legends according to the QgsWmsSettings
* @added in 2.8
@@ -475,6 +475,8 @@ void QgsWMSSourceSelect::on_btnConnect_clicked()
return;
}

mFeatureCount->setEnabled( caps.identifyCapabilities() != QgsRasterInterface::NoCapabilities );

populateLayerList( caps );
}

0 comments on commit aff98f5

Please sign in to comment.
You can’t perform that action at this time.