Skip to content

Commit c749d98

Browse files
mhugentrldhont
authored andcommitted
WMS 1.3.0 compliance: throw exception if feature info point is not within the WIDTH/HEIGHT parameters
1 parent 3a76dc5 commit c749d98

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/server/qgswmsserver.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,12 @@ bool QgsWMSServer::infoPointToMapCoordinates( int i, int j, QgsPoint* infoPoint,
21512151
return false;
21522152
}
21532153

2154+
//check if i, j are in the pixel range of the image
2155+
if ( i < 0 || i > mapRenderer->width() || j < 0 || j > mapRenderer->height() )
2156+
{
2157+
throw QgsMapServiceException( "InvalidPoint", "I/J parameters not within the pixel range" );
2158+
}
2159+
21542160
double xRes = mapRenderer->extent().width() / mapRenderer->width();
21552161
double yRes = mapRenderer->extent().height() / mapRenderer->height();
21562162
infoPoint->setX( mapRenderer->extent().xMinimum() + i * xRes + xRes / 2.0 );

0 commit comments

Comments
 (0)