Skip to content

Commit 2430d9c

Browse files
committedMar 28, 2019
Update InvalidPoint exception
1 parent 37b9499 commit 2430d9c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,16 @@ namespace QgsWms
835835
static void infoPointToMapCoordinates( int i, int j, QgsPointXY *infoPoint, const QgsMapSettings &mapSettings )
836836
{
837837
//check if i, j are in the pixel range of the image
838-
if ( i < 0 || i > mapSettings.outputSize().width() || j < 0 || j > mapSettings.outputSize().height() )
838+
if ( i < 0 || i > mapSettings.outputSize().width() )
839839
{
840-
throw QgsBadRequestException( "InvalidPoint", "I/J parameters not within the pixel range" );
840+
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
841+
mWmsParameters[QgsWmsParameter::I] );
842+
}
843+
844+
if ( j < 0 || j > mapSettings.outputSize().height() )
845+
{
846+
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
847+
mWmsParameters[QgsWmsParameter::J] );
841848
}
842849

843850
double xRes = mapSettings.extent().width() / mapSettings.outputSize().width();

0 commit comments

Comments
 (0)
Please sign in to comment.