Skip to content
Permalink
Browse files

Fix compilation

  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent 4c09957 commit 75ba90955d6ba9842f8a2c1e1f2360cb0bd324ae
@@ -67,7 +67,7 @@ namespace QgsWms
break;
default:
throw QgsBadRequestException( QgsServiceException::OGC_INVALID_FORMAT,
mWmsParameters[QgsWmsParameter::FORMAT] );
parameters[QgsWmsParameter::FORMAT] );
break;
}

@@ -30,10 +30,10 @@ namespace QgsWms
QgsServerResponse &response )
{
// get wms parameters from query
const QgsWmsParameters wmsParameters( QUrlQuery( request.url() ) );
const QgsWmsParameters parameters( QUrlQuery( request.url() ) );

// GetPrint supports svg/png/pdf
const QgsWmsParameters::Format format = wmsParameters.format();
const QgsWmsParameters::Format format = parameters.format();
QString contentType;
switch ( format )
{
@@ -51,7 +51,7 @@ namespace QgsWms
break;
default:
throw QgsBadRequestException( QgsServiceException::OGC_INVALID_FORMAT,
mWmsParameters[QgsWmsParameter::FORMAT] );
parameters[QgsWmsParameter::FORMAT] );
break;
}

@@ -64,7 +64,7 @@ namespace QgsWms
context.setFlag( QgsWmsRenderContext::SetAccessControl );
context.setFlag( QgsWmsRenderContext::AddHighlightLayers );
context.setFlag( QgsWmsRenderContext::AddExternalLayers );
context.setParameters( wmsParameters );
context.setParameters( parameters );

// rendering
QgsRenderer renderer( context );
@@ -18,6 +18,7 @@
#include "qgslayertree.h"

#include "qgswmsrendercontext.h"
#include "qgswmsserviceexception.h"
#include "qgsserverprojectutils.h"

using namespace QgsWms;
@@ -837,14 +837,18 @@ namespace QgsWms
//check if i, j are in the pixel range of the image
if ( i < 0 || i > mapSettings.outputSize().width() )
{
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
mWmsParameters[QgsWmsParameter::I] );
QgsWmsParameter param( QgsWmsParameter::I );
param.mValue = i;
throw QgsBadRequestException( QgsServiceException::OGC_INVALID_POINT,
param );
}

if ( j < 0 || j > mapSettings.outputSize().height() )
{
throw QgsBadRequestException( QgsServiceException::INVALID_POINT,
mWmsParameters[QgsWmsParameter::J] );
QgsWmsParameter param( QgsWmsParameter::J );
param.mValue = j;
throw QgsBadRequestException( QgsServiceException::OGC_INVALID_POINT,
param );
}

double xRes = mapSettings.extent().width() / mapSettings.outputSize().width();
@@ -56,6 +56,7 @@ namespace QgsWms
OGC_INVALID_UPDATE_SEQUENCE,
OGC_MISSING_DIMENSION_VALUE,
OGC_INVALID_DIMENSION_VALUE,
OGC_INVALID_POINT, // new in WMS 1.3.0
OGC_INVALID_CRS, // new in WMS 1.3.0
OGC_OPERATION_NOT_SUPPORTED, // new in WMS 1.3.0
QGIS_MISSING_PARAMETER_VALUE,
@@ -137,6 +138,11 @@ namespace QgsWms
message = QStringLiteral( "The layer '%1' is not queryable." ).arg( parameter.toString() );
break;
}
case OGC_INVALID_POINT:
{
message = QStringLiteral( "The point '%1' from '%2' is invalid." ).arg( parameter.toString(), name );
break;
}
case OGC_STYLE_NOT_DEFINED:
case OGC_CURRENT_UPDATE_SEQUENCE:
case OGC_INVALID_UPDATE_SEQUENCE:
@@ -161,8 +161,10 @@ namespace QgsWms
}
else
{
QgsWmsParameter parameter( QgsWmsParameter::FORMAT );
parameter.mValue = formatStr;
throw QgsBadRequestException( QgsServiceException::OGC_INVALID_FORMAT,
mWmsParameters[QgsWmsParameter::FORMAT] );
parameter );
}
}
} // namespace QgsWms

0 comments on commit 75ba909

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