Skip to content
Permalink
Browse files

WMS 1.3.0 compliance: throw exception if bbox is empty

  • Loading branch information
mhugent committed Nov 29, 2016
1 parent 6e8e736 commit 1fd290f24398cb9145662ec9e029af4f901765fd
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/server/qgswmsserver.cpp
@@ -694,6 +694,10 @@ static QgsRectangle _parseBBOX( const QString &bboxStr, bool &ok )
}

ok = true;
if ( d[2] <= d[0] || d[3] <= d[1] )
{
throw QgsMapServiceException( "InvalidParameterValue", "BBOX is empty" );
}
return QgsRectangle( d[0], d[1], d[2], d[3] );
}

@@ -2044,6 +2048,11 @@ int QgsWmsServer::configureMapRender( const QPaintDevice* paintDevice ) const
throw QgsMapServiceException( QStringLiteral( "InvalidParameterValue" ), QStringLiteral( "Invalid BBOX parameter" ) );
}

if ( mapExtent.isEmpty() )
{
throw QgsMapServiceException( "InvalidParameterValue", "BBOX is empty" );
}

QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceDegrees;

QString crs = mParameters.value( QStringLiteral( "CRS" ), mParameters.value( QStringLiteral( "SRS" ) ) );

0 comments on commit 1fd290f

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