WMS 1.3.0 compliance: throw exception if bbox is empty

This commit is contained in:
Marco Hugentobler 2016-11-29 14:28:51 +01:00
parent 6e8e7369d2
commit 1fd290f243

View File

@ -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" ) ) );