Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BUFIX][Server] GetFeatureInfo on Raster Layer, fix valid identify
Manually merge to QGIS 3 from 2.18

Funded by Ifremer
  • Loading branch information
rldhont committed Sep 19, 2017
1 parent 20e1d72 commit f5c4fdf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -1640,19 +1640,25 @@ namespace QgsWms
{
return false;
}
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 ( layer->dataProvider()->crs() != mapSettings.destinationCrs() )
{
attributes = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue ).results();
identifyResult = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue );
}
else
{
attributes = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue, mapSettings.extent(), mapSettings.outputSize().width(), mapSettings.outputSize().height() ).results();
identifyResult = layer->dataProvider()->identify( *infoPoint, QgsRaster::IdentifyFormatValue, mapSettings.extent(), mapSettings.outputSize().width(), mapSettings.outputSize().height() );
}

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

QMap<int, QVariant> attributes = identifyResult.results();

if ( mWmsParameters.infoFormat() == QgsWmsParameters::Format::GML )
{
QgsFeature feature;
Expand Down

0 comments on commit f5c4fdf

Please sign in to comment.