Skip to content
Permalink
Browse files

WMS 1.3.0 compliance: throw exception if feature info point is not wi…

…thin the WIDTH/HEIGHT parameters
  • Loading branch information
mhugent authored and rldhont committed Dec 12, 2016
1 parent 3a76dc5 commit c749d98e864cf79806577e64a04b3617bf5a76f8
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/server/qgswmsserver.cpp
@@ -2151,6 +2151,12 @@ bool QgsWMSServer::infoPointToMapCoordinates( int i, int j, QgsPoint* infoPoint,
return false;
}

//check if i, j are in the pixel range of the image
if ( i < 0 || i > mapRenderer->width() || j < 0 || j > mapRenderer->height() )
{
throw QgsMapServiceException( "InvalidPoint", "I/J parameters not within the pixel range" );
}

double xRes = mapRenderer->extent().width() / mapRenderer->width();
double yRes = mapRenderer->extent().height() / mapRenderer->height();
infoPoint->setX( mapRenderer->extent().xMinimum() + i * xRes + xRes / 2.0 );

0 comments on commit c749d98

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