Skip to content

Commit

Permalink
[Server] WMS GetFeatureInfo Raster GML: do not add attribute for no data
Browse files Browse the repository at this point in the history
For WMS GetFeatureInfo request on a raster layer with GML as output, if the
identify value is null, do not ad the band as an attribute.
  • Loading branch information
rldhont committed Jun 12, 2018
1 parent 2895819 commit 146a398
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/server/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,12 +2582,7 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,
int index = 0;
Q_FOREACH ( int bandNo, values.keys() )
{
if ( values.value( bandNo ).isNull() )
{
fields.append( QgsField( layer->bandName( bandNo ), QVariant::String ) );
feature.setAttribute( index++, "no data" );
}
else
if ( !values.value( bandNo ).isNull() )
{
QVariant value( values.value( bandNo ) );
fields.append( QgsField( layer->bandName( bandNo ), QVariant::Double ) );
Expand Down

0 comments on commit 146a398

Please sign in to comment.