Skip to content

Commit bf82848

Browse files
author
Marcel Dancak
committedJun 3, 2014
mapserver: excluding of not allowed WMS feature attributes from GetFeatureInfo response in GML format
1 parent d9bbd57 commit bf82848

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎src/mapserver/qgswmsserver.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2868,12 +2868,18 @@ QDomElement QgsWMSServer::createFeatureGML(
28682868
}
28692869
}
28702870

2871-
//read all attribute values from the feature
2871+
//read all allowed attribute values from the feature
2872+
const QSet<QString>& excludedAttributes = layer->excludeAttributesWMS();
28722873
QgsAttributes featureAttributes = feat->attributes();
28732874
const QgsFields* fields = feat->fields();
28742875
for ( int i = 0; i < fields->count(); ++i )
28752876
{
28762877
QString attributeName = fields->at( i ).name();
2878+
//skip attribute if it is explicitly excluded from WMS publication
2879+
if ( excludedAttributes.contains( attributeName ) )
2880+
{
2881+
continue;
2882+
}
28772883
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QString( " " ), QString( "_" ) ) );
28782884
QString fieldTextString = featureAttributes[i].toString();
28792885
if ( layer )

0 commit comments

Comments
 (0)
Please sign in to comment.