Skip to content

Commit

Permalink
Update InvalidPoint exception
Browse files Browse the repository at this point in the history
  • 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
Original file line number Diff line number Diff line change
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.