Skip to content

Commit

Permalink
WMS 1.3.0 compliance: throw exception if bbox is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Nov 29, 2016
1 parent 6e8e736 commit 1fd290f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server/qgswmsserver.cpp
Expand Up @@ -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] );
}

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

0 comments on commit 1fd290f

Please sign in to comment.