Skip to content

Commit

Permalink
Merge pull request #5664 from rldhont/server-getfeatureinfo-raster-di…
Browse files Browse the repository at this point in the history
…splay

[BUGFIX][Server] GetFeaturInfo: do not identify raster data if point …
  • Loading branch information
rldhont authored Nov 17, 2017
2 parents 48c320b + 861987d commit 1989111
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/server/services/wms/qgswmsrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,23 +1319,27 @@ namespace QgsWms
}
else
{
QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *>( layer );
if ( !rasterLayer )
{
break;
}
if ( !infoPoint )
{
break;
}
QgsPointXY layerInfoPoint = mapSettings.mapToLayerCoordinates( layer, *( infoPoint.get() ) );
if ( !rasterLayer->extent().contains( layerInfoPoint ) )
{
break;
}
if ( infoFormat == QgsWmsParameters::Format::GML )
{
layerElement = result.createElement( QStringLiteral( "gml:featureMember" )/*wfs:FeatureMember*/ );
getFeatureInfoElement.appendChild( layerElement );
}

QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *>( layer );
if ( rasterLayer )
{
if ( !infoPoint )
{
break;
}
QgsPointXY layerInfoPoint = mapSettings.mapToLayerCoordinates( layer, *( infoPoint.get() ) );
( void )featureInfoFromRasterLayer( rasterLayer, mapSettings, &layerInfoPoint, result, layerElement, version );
break;
}
( void )featureInfoFromRasterLayer( rasterLayer, mapSettings, &layerInfoPoint, result, layerElement, version );
}
break;
}
Expand Down

0 comments on commit 1989111

Please sign in to comment.