Skip to content
Permalink
Browse files

[Server] Refactoring, removing config parser from WMS

  • Loading branch information
rldhont committed Aug 25, 2017
1 parent 51f1b83 commit a35af0c101e64b94980768217e2e3b7af4896db9
@@ -129,6 +129,14 @@ namespace QgsServerProjectUtils
:rtype: int
%End

int wmsImageQuality( const QgsProject &project );
%Docstring
Returns the quality for WMS images defined in a QGIS project.
\param project the QGIS project
:return: quality if defined in project, -1 otherwise.
:rtype: int
%End

bool wmsUseLayerIds( const QgsProject &project );
%Docstring
Returns if layer ids are used as name in WMS.
@@ -105,6 +105,11 @@ bool QgsServerProjectUtils::wmsUseLayerIds( const QgsProject &project )
return project.readBoolEntry( QStringLiteral( "WMSUseLayerIDs" ), QStringLiteral( "/" ), false );
}

int QgsServerProjectUtils::wmsImageQuality( const QgsProject &project )
{
return project.readNumEntry( QStringLiteral( "WMSImageQuality" ), QStringLiteral( "/" ), -1 );
}

bool QgsServerProjectUtils::wmsInfoFormatSia2045( const QgsProject &project )
{
QString sia2045 = project.readEntry( QStringLiteral( "WMSInfoFormatSIA2045" ), QStringLiteral( "/" ), "" );
@@ -120,6 +120,12 @@ namespace QgsServerProjectUtils
*/
SERVER_EXPORT int wmsMaxHeight( const QgsProject &project );

/** Returns the quality for WMS images defined in a QGIS project.
* \param project the QGIS project
* \returns quality if defined in project, -1 otherwise.
*/
SERVER_EXPORT int wmsImageQuality( const QgsProject &project );

/** Returns if layer ids are used as name in WMS.
* \param project the QGIS project
* \returns if layer ids are used as name.
@@ -54,7 +54,7 @@ namespace QgsWms
Q_UNUSED( version );

QgsServerRequest::Parameters params = request.parameters();
QgsRenderer renderer( serverIface, project, params, getConfigParser( serverIface ) );
QgsRenderer renderer( serverIface, project, params );

QMap<QString, QString> formatOptionsMap = parseFormatOptions( params.value( QStringLiteral( "FORMAT_OPTIONS" ) ) );

@@ -67,8 +67,6 @@ namespace QgsWms
{
Q_UNUSED( version );

//QgsWmsConfigParser *configParser = getConfigParser( serverIface );

QDomDocument doc;
QDomProcessingInstruction xmlDeclaration = doc.createProcessingInstruction( QStringLiteral( "xml" ),
QStringLiteral( "version=\"1.0\" encoding=\"utf-8\"" ) );
@@ -31,7 +31,7 @@ namespace QgsWms
{
Q_UNUSED( version );
QgsServerRequest::Parameters params = request.parameters();
QgsRenderer renderer( serverIface, project, params, getConfigParser( serverIface ) );
QgsRenderer renderer( serverIface, project, params );

QString infoFormat = params.value( QStringLiteral( "INFO_FORMAT" ), QStringLiteral( "text/plain" ) );

@@ -34,7 +34,7 @@ namespace QgsWms
Q_UNUSED( version );

QgsServerRequest::Parameters params = request.parameters();
QgsRenderer renderer( serverIface, project, params, getConfigParser( serverIface ) );
QgsRenderer renderer( serverIface, project, params );

std::unique_ptr<QImage> result( renderer.getLegendGraphics() );

@@ -34,7 +34,7 @@ namespace QgsWms
Q_UNUSED( version );

QgsServerRequest::Parameters params = request.parameters();
QgsRenderer renderer( serverIface, project, params, getConfigParser( serverIface ) );
QgsRenderer renderer( serverIface, project, params );

std::unique_ptr<QImage> result( renderer.getMap() );
if ( result )
@@ -32,7 +32,7 @@ namespace QgsWms

Q_UNUSED( version );

QgsRenderer renderer( serverIface, project, params, getConfigParser( serverIface ) );
QgsRenderer renderer( serverIface, project, params );

QString format = params.value( "FORMAT" );
QString contentType;

0 comments on commit a35af0c

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