Skip to content

Commit

Permalink
mapserver: excluding of not allowed WMS feature attributes from GetFe…
Browse files Browse the repository at this point in the history
…atureInfo response in GML format
  • Loading branch information
Marcel Dancak committed Jun 3, 2014
1 parent d9bbd57 commit bf82848
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mapserver/qgswmsserver.cpp
Expand Up @@ -2868,12 +2868,18 @@ QDomElement QgsWMSServer::createFeatureGML(
}
}

//read all attribute values from the feature
//read all allowed attribute values from the feature
const QSet<QString>& excludedAttributes = layer->excludeAttributesWMS();
QgsAttributes featureAttributes = feat->attributes();
const QgsFields* fields = feat->fields();
for ( int i = 0; i < fields->count(); ++i )
{
QString attributeName = fields->at( i ).name();
//skip attribute if it is explicitly excluded from WMS publication
if ( excludedAttributes.contains( attributeName ) )
{
continue;
}
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QString( " " ), QString( "_" ) ) );
QString fieldTextString = featureAttributes[i].toString();
if ( layer )
Expand Down

0 comments on commit bf82848

Please sign in to comment.