Skip to content
Permalink
Browse files

[BUFIX][Server] GetFeatureInfo on Raster Layer, fix valid identify

Needs to be manually apply to QGIS 3

Funded by Ifremer
  • Loading branch information
rldhont committed Sep 12, 2017
1 parent d8fa85e commit c3417bb46af57a14cc7bbcb299cd07349b3db6c6
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/server/qgswmsserver.cpp
@@ -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;

0 comments on commit c3417bb

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