Skip to content
Permalink
Browse files

Update InvalidPoint exception

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 37b9499 commit 2430d9cc8b47e417ddcdf9dd4077439bc3391a29
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/server/services/wms/qgswmsrenderer.cpp
@@ -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();

0 comments on commit 2430d9c

Please sign in to comment.
You can’t perform that action at this time.