Skip to content

Commit 63f496c

Browse files
committedNov 29, 2016
WMS 1.3.0 compliance: throw exception if feature info point is not within the WIDTH/HEIGHT parameters
1 parent df411eb commit 63f496c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/server/qgswmsserver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,12 @@ bool QgsWmsServer::infoPointToMapCoordinates( int i, int j, QgsPoint* infoPoint,
21602160
return false;
21612161
}
21622162

2163+
//check if i, j are in the pixel range of the image
2164+
if ( i < 0 || i > mapRenderer->width() || j < 0 || j > mapRenderer->height() )
2165+
{
2166+
throw QgsMapServiceException( "InvalidPoint", "I/J parameters not within the pixel range" );
2167+
}
2168+
21632169
double xRes = mapRenderer->extent().width() / mapRenderer->width();
21642170
double yRes = mapRenderer->extent().height() / mapRenderer->height();
21652171
infoPoint->setX( mapRenderer->extent().xMinimum() + i * xRes + xRes / 2.0 );

0 commit comments

Comments
 (0)
Please sign in to comment.