Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update InvalidPoint exception
  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 37b9499 commit 2430d9c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -835,9 +835,16 @@ namespace QgsWms
static void infoPointToMapCoordinates( int i, int j, QgsPointXY *infoPoint, const QgsMapSettings &mapSettings )
{
//check if i, j are in the pixel range of the image
if ( i < 0 || i > mapSettings.outputSize().width() || j < 0 || j > mapSettings.outputSize().height() )
if ( i < 0 || i > mapSettings.outputSize().width() )
{
throw QgsBadRequestException( "InvalidPoint", "I/J parameters not within the pixel range" );
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
mWmsParameters[QgsWmsParameter::I] );
}

if ( j < 0 || j > mapSettings.outputSize().height() )
{
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
mWmsParameters[QgsWmsParameter::J] );
}

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

0 comments on commit 2430d9c

Please sign in to comment.