Skip to content
Permalink
Browse files

[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 f5c4fdff2e9b7b93af138a5dcbdb8de2887d3198
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/server/services/wms/qgswmsrenderer.cpp
@@ -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;

0 comments on commit f5c4fdf

Please sign in to comment.
You can’t perform that action at this time.