QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsserverprojectutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsserverprojectutils.h
3 -----------------------
4 begin : December 19, 2016
5 copyright : (C) 2016 by Paul Blottiere
6 email : paul dot blottiere at oslandia dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSSERVERPROJECTUTILS_H
19#define QGSSERVERPROJECTUTILS_H
20
21#include <cmath>
22
23#include "qgis_server.h"
24#include "qgis_sip.h"
25#include "qgsserverrequest.h"
26#include "qgsserversettings.h"
27
28#include <QHash>
29#include <QString>
30
31class QgsProject;
32class QgsRectangle;
33
39class SERVER_EXPORT QgsServerProjectUtils
40{
41 public:
47 static double ceilWithPrecision( double number, int places ) SIP_SKIP;
48
54 static double floorWithPrecision( double number, int places ) SIP_SKIP;
55
61 static bool owsServiceCapabilities( const QgsProject &project );
62
68 static QString owsServiceTitle( const QgsProject &project );
69
75 static QString owsServiceAbstract( const QgsProject &project );
76
82 static QStringList owsServiceKeywords( const QgsProject &project );
83
89 static QString owsServiceOnlineResource( const QgsProject &project );
90
96 static QString owsServiceContactOrganization( const QgsProject &project );
97
103 static QString owsServiceContactPosition( const QgsProject &project );
104
110 static QString owsServiceContactPerson( const QgsProject &project );
111
117 static QString owsServiceContactMail( const QgsProject &project );
118
124 static QString owsServiceContactPhone( const QgsProject &project );
125
131 static QString owsServiceFees( const QgsProject &project );
132
138 static QString owsServiceAccessConstraints( const QgsProject &project );
139
145 static int wmsMaxWidth( const QgsProject &project );
146
152 static int wmsMaxHeight( const QgsProject &project );
153
159 static int wmsImageQuality( const QgsProject &project );
160
167 static int wmsTileBuffer( const QgsProject &project );
168
181 static bool wmsRenderMapTiles( const QgsProject &project );
182
188 static int wmsMaxAtlasFeatures( const QgsProject &project );
189
196 static double wmsDefaultMapUnitsPerMm( const QgsProject &project );
197
203 static bool wmsUseLayerIds( const QgsProject &project );
204
210 static bool wmsInfoFormatSia2045( const QgsProject &project );
211
217 static bool wmsFeatureInfoAddWktGeometry( const QgsProject &project );
218
224 static bool wmsFeatureInfoUseAttributeFormSettings( const QgsProject &project );
225
234 static bool wmsHTMLFeatureInfoUseOnlyMaptip( const QgsProject &project );
235
241 static bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project );
242
248 static bool wmsAddLegendGroupsLegendGraphic( const QgsProject &project );
249
256 static bool wmsSkipNameForGroup( const QgsProject &project );
257
263 static int wmsFeatureInfoPrecision( const QgsProject &project );
264
270 static QString wmsFeatureInfoDocumentElement( const QgsProject &project );
271
277 static QString wmsFeatureInfoDocumentElementNs( const QgsProject &project );
278
284 static QString wmsFeatureInfoSchema( const QgsProject &project );
285
291 static QHash<QString, QString> wmsFeatureInfoLayerAliasMap( const QgsProject &project );
292
298 static bool wmsInspireActivate( const QgsProject &project );
299
305 static QString wmsInspireLanguage( const QgsProject &project );
306
312 static QString wmsInspireMetadataUrl( const QgsProject &project );
313
319 static QString wmsInspireMetadataUrlType( const QgsProject &project );
320
326 static QString wmsInspireTemporalReference( const QgsProject &project );
327
333 static QString wmsInspireMetadataDate( const QgsProject &project );
334
340 static QStringList wmsRestrictedComposers( const QgsProject &project );
341
351 static QString wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() );
352
358 static QString wmsRootName( const QgsProject &project );
359
365 static QStringList wmsRestrictedLayers( const QgsProject &project );
366
372 static QStringList wmsOutputCrsList( const QgsProject &project );
373
380 static QStringList wmsOutputCrsListAsOgcUrn( const QgsProject &project );
381
387 static QgsRectangle wmsExtent( const QgsProject &project );
388
398 static QString wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() );
399
405 static QStringList wfsLayerIds( const QgsProject &project );
406
413
414 static int wfsLayerPrecision( const QgsProject &project, const QString &layerId );
415
421 static QStringList wfstUpdateLayerIds( const QgsProject &project );
422
428 static QStringList wfstInsertLayerIds( const QgsProject &project );
429
435 static QStringList wfstDeleteLayerIds( const QgsProject &project );
436
446 static QString wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() );
447
453 static QStringList wcsLayerIds( const QgsProject &project );
454
465 static QString wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request = QgsServerRequest(), const QgsServerSettings &settings = QgsServerSettings() );
466
487 static QString serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings );
488};
489
490#endif
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
A rectangle specified with double values.
Contains utility functions to retrieve specific entries from a QgsProject.
static QString wmsFeatureInfoSchema(const QgsProject &project)
Returns the schema URL for XML GetFeatureInfo request.
static int wmsTileBuffer(const QgsProject &project)
Returns the tile buffer in pixels for WMS images defined in a QGIS project.
static QString wcsServiceUrl(const QgsProject &project, const QgsServerRequest &request=QgsServerRequest(), const QgsServerSettings &settings=QgsServerSettings())
Returns the WCS service url.
static QString wmsRootName(const QgsProject &project)
Returns the WMS root layer name defined in a QGIS project.
static bool wmsInfoFormatSia2045(const QgsProject &project)
Returns if the info format is SIA20145.
static bool wmsSkipNameForGroup(const QgsProject &project)
Returns if name attribute should be skipped for groups in WMS capabilities document.
static QString wmsInspireMetadataUrl(const QgsProject &project)
Returns the Inspire metadata URL.
static bool wmsHTMLFeatureInfoUseOnlyMaptip(const QgsProject &project)
Returns if only the maptip should be used for HTML feature info response so that the HTML response to...
static QString wmtsServiceUrl(const QgsProject &project, const QgsServerRequest &request=QgsServerRequest(), const QgsServerSettings &settings=QgsServerSettings())
Returns the WMTS service url.
static int wmsFeatureInfoPrecision(const QgsProject &project)
Returns the geometry precision for GetFeatureInfo request.
static double ceilWithPrecision(double number, int places)
Returns a double greater than number to the specified number of places.
static QString wmsFeatureInfoDocumentElementNs(const QgsProject &project)
Returns the document element namespace for XML GetFeatureInfo request.
static QStringList wmsRestrictedComposers(const QgsProject &project)
Returns the restricted composer list.
static QgsRectangle wmsExtent(const QgsProject &project)
Returns the WMS Extent restriction.
static bool wmsUseLayerIds(const QgsProject &project)
Returns if layer ids are used as name in WMS.
static bool wmsFeatureInfoSegmentizeWktGeometry(const QgsProject &project)
Returns if the geometry has to be segmentize in GetFeatureInfo request.
static QString owsServiceAccessConstraints(const QgsProject &project)
Returns the owsService access constraints defined in project.
static QStringList wfsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WFS.
static bool wmsRenderMapTiles(const QgsProject &project)
Returns true if WMS requests should use the QgsMapSettings::RenderMapTile flag, so that no visible ar...
static QString owsServiceOnlineResource(const QgsProject &project)
Returns the owsService online resource defined in project.
static QString owsServiceFees(const QgsProject &project)
Returns the owsService fees defined in project.
static QStringList owsServiceKeywords(const QgsProject &project)
Returns the owsService keywords defined in project.
static QString owsServiceContactPosition(const QgsProject &project)
Returns the owsService contact position defined in project.
static QStringList wfstUpdateLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities.
static bool wmsFeatureInfoUseAttributeFormSettings(const QgsProject &project)
Returns if feature form settings should be considered for the format of the feature info response.
static QStringList wmsOutputCrsListAsOgcUrn(const QgsProject &project)
Returns the WMS output CRS list as OGC URNs.
static QString serviceUrl(const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings)
Returns the service url defined in the environment variable or with HTTP header.
static QStringList wfstInsertLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities.
static QString wmsInspireTemporalReference(const QgsProject &project)
Returns the Inspire temporal reference.
static QStringList wmsOutputCrsList(const QgsProject &project)
Returns the WMS output CRS list.
static QString wmsInspireMetadataDate(const QgsProject &project)
Returns the Inspire metadata date.
static QString owsServiceContactOrganization(const QgsProject &project)
Returns the owsService contact organization defined in project.
static QHash< QString, QString > wmsFeatureInfoLayerAliasMap(const QgsProject &project)
Returns the mapping between layer name and wms layer name for GetFeatureInfo request.
static bool wmsFeatureInfoAddWktGeometry(const QgsProject &project)
Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.
static QString wmsServiceUrl(const QgsProject &project, const QgsServerRequest &request=QgsServerRequest(), const QgsServerSettings &settings=QgsServerSettings())
Returns the WMS service url.
static QStringList wmsRestrictedLayers(const QgsProject &project)
Returns the restricted layer name list.
static int wmsImageQuality(const QgsProject &project)
Returns the quality for WMS images defined in a QGIS project.
static QString wmsInspireLanguage(const QgsProject &project)
Returns the Inspire language.
static QString wmsInspireMetadataUrlType(const QgsProject &project)
Returns the Inspire metadata URL type.
static double wmsDefaultMapUnitsPerMm(const QgsProject &project)
Returns the default number of map units per millimeters in case of the scale is not given.
static bool owsServiceCapabilities(const QgsProject &project)
Returns if owsService capabilities are enabled.
static bool wmsInspireActivate(const QgsProject &project)
Returns if Inspire is activated.
static int wmsMaxWidth(const QgsProject &project)
Returns the maximum width for WMS images defined in a QGIS project.
static QString owsServiceTitle(const QgsProject &project)
Returns the owsService title defined in project.
static QString owsServiceContactMail(const QgsProject &project)
Returns the owsService contact mail defined in project.
static QString owsServiceAbstract(const QgsProject &project)
Returns the owsService abstract defined in project.
static double floorWithPrecision(double number, int places)
Returns a double less than number to the specified number of places.
static QStringList wfstDeleteLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities.
static QString wfsServiceUrl(const QgsProject &project, const QgsServerRequest &request=QgsServerRequest(), const QgsServerSettings &settings=QgsServerSettings())
Returns the WFS service url.
static int wmsMaxHeight(const QgsProject &project)
Returns the maximum height for WMS images defined in a QGIS project.
static QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
static bool wmsAddLegendGroupsLegendGraphic(const QgsProject &project)
Returns if legend groups should be in the legend graphic response if GetLegendGraphic is called on a ...
static QString wmsFeatureInfoDocumentElement(const QgsProject &project)
Returns the document element name for XML GetFeatureInfo request.
static int wmsMaxAtlasFeatures(const QgsProject &project)
Returns the maximum number of atlas features which can be printed in a request.
static QString owsServiceContactPhone(const QgsProject &project)
Returns the owsService contact phone defined in project.
static int wfsLayerPrecision(const QgsProject &project, const QString &layerId)
Returns the Layer precision defined in a QGIS project for the WFS GetFeature.
static QString owsServiceContactPerson(const QgsProject &project)
Returns the owsService contact person defined in project.
Defines requests passed to QgsService classes.
Provides a way to retrieve settings by prioritizing according to environment variables,...
#define SIP_SKIP
Definition qgis_sip.h:134