Skip to content

Commit

Permalink
[BUFIX][Server] GetFeatureInfo on Raster Layer, fix valid identify
Browse files Browse the repository at this point in the history
Needs to be manually apply to QGIS 3

Funded by Ifremer
  • Loading branch information
rldhont committed Sep 13, 2017
1 parent d8fa85e commit c3417bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server/qgswmsserver.cpp
Expand Up @@ -2535,19 +2535,23 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,
{
return 1;
}
QMap<int, QVariant> attributes;
QgsRasterIdentifyResult identifyResult;
// use context extent, width height (comes with request) to use WCS cache
// We can only use context if raster is not reprojected, otherwise it is difficult
// to guess correct source resolution
if ( mMapRenderer->hasCrsTransformEnabled() && layer->dataProvider()->crs() != mMapRenderer->destinationCrs() )
{
attributes = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue ).results();
identifyResult = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue );
}
else
{
attributes = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue, mMapRenderer->extent(), mMapRenderer->outputSize().width(), mMapRenderer->outputSize().height() ).results();
identifyResult = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue, mMapRenderer->extent(), mMapRenderer->outputSize().width(), mMapRenderer->outputSize().height() );
}

if ( !identifyResult.isValid() )
return 1;

QMap<int, QVariant> attributes = identifyResult.results();
if ( infoFormat == "application/vnd.ogc.gml" )
{
QgsFeature feature;
Expand Down

0 comments on commit c3417bb

Please sign in to comment.