QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 <QString>
22 #include <QHash>
23 #include <cmath>
24 
25 #include "qgis_server.h"
26 #include "qgis_sip.h"
27 
28 class QgsProject;
29 class QgsRectangle;
30 
31 #ifdef SIP_RUN
32 % ModuleHeaderCode
33 #include "qgsserverprojectutils.h"
34 % End
35 #endif
36 
37 
45 {
46 
52  SERVER_EXPORT double ceilWithPrecision( double number, int places ) SIP_SKIP;
53 
59  SERVER_EXPORT double floorWithPrecision( double number, int places ) SIP_SKIP;
60 
66  SERVER_EXPORT bool owsServiceCapabilities( const QgsProject &project );
67 
73  SERVER_EXPORT QString owsServiceTitle( const QgsProject &project );
74 
80  SERVER_EXPORT QString owsServiceAbstract( const QgsProject &project );
81 
87  SERVER_EXPORT QStringList owsServiceKeywords( const QgsProject &project );
88 
94  SERVER_EXPORT QString owsServiceOnlineResource( const QgsProject &project );
95 
101  SERVER_EXPORT QString owsServiceContactOrganization( const QgsProject &project );
102 
108  SERVER_EXPORT QString owsServiceContactPosition( const QgsProject &project );
109 
115  SERVER_EXPORT QString owsServiceContactPerson( const QgsProject &project );
116 
122  SERVER_EXPORT QString owsServiceContactMail( const QgsProject &project );
123 
129  SERVER_EXPORT QString owsServiceContactPhone( const QgsProject &project );
130 
136  SERVER_EXPORT QString owsServiceFees( const QgsProject &project );
137 
143  SERVER_EXPORT QString owsServiceAccessConstraints( const QgsProject &project );
144 
150  SERVER_EXPORT int wmsMaxWidth( const QgsProject &project );
151 
157  SERVER_EXPORT int wmsMaxHeight( const QgsProject &project );
158 
164  SERVER_EXPORT int wmsImageQuality( const QgsProject &project );
165 
172  SERVER_EXPORT int wmsTileBuffer( const QgsProject &project );
173 
179  SERVER_EXPORT int wmsMaxAtlasFeatures( const QgsProject &project );
180 
187  SERVER_EXPORT double wmsDefaultMapUnitsPerMm( const QgsProject &project );
188 
194  SERVER_EXPORT bool wmsUseLayerIds( const QgsProject &project );
195 
201  SERVER_EXPORT bool wmsInfoFormatSia2045( const QgsProject &project );
202 
208  SERVER_EXPORT bool wmsFeatureInfoAddWktGeometry( const QgsProject &project );
209 
215  SERVER_EXPORT bool wmsFeatureInfoSegmentizeWktGeometry( const QgsProject &project );
216 
222  SERVER_EXPORT int wmsFeatureInfoPrecision( const QgsProject &project );
223 
229  SERVER_EXPORT QString wmsFeatureInfoDocumentElement( const QgsProject &project );
230 
236  SERVER_EXPORT QString wmsFeatureInfoDocumentElementNs( const QgsProject &project );
237 
243  SERVER_EXPORT QString wmsFeatureInfoSchema( const QgsProject &project );
244 
250  SERVER_EXPORT QHash<QString, QString> wmsFeatureInfoLayerAliasMap( const QgsProject &project );
251 
257  SERVER_EXPORT bool wmsInspireActivate( const QgsProject &project );
258 
264  SERVER_EXPORT QString wmsInspireLanguage( const QgsProject &project );
265 
271  SERVER_EXPORT QString wmsInspireMetadataUrl( const QgsProject &project );
272 
278  SERVER_EXPORT QString wmsInspireMetadataUrlType( const QgsProject &project );
279 
285  SERVER_EXPORT QString wmsInspireTemporalReference( const QgsProject &project );
286 
292  SERVER_EXPORT QString wmsInspireMetadataDate( const QgsProject &project );
293 
299  SERVER_EXPORT QStringList wmsRestrictedComposers( const QgsProject &project );
300 
306  SERVER_EXPORT QString wmsServiceUrl( const QgsProject &project );
307 
313  SERVER_EXPORT QString wmsRootName( const QgsProject &project );
314 
320  SERVER_EXPORT QStringList wmsRestrictedLayers( const QgsProject &project );
321 
327  SERVER_EXPORT QStringList wmsOutputCrsList( const QgsProject &project );
328 
334  SERVER_EXPORT QgsRectangle wmsExtent( const QgsProject &project );
335 
341  SERVER_EXPORT QString wfsServiceUrl( const QgsProject &project );
342 
348  SERVER_EXPORT QStringList wfsLayerIds( const QgsProject &project );
349 
357  SERVER_EXPORT int wfsLayerPrecision( const QgsProject &project, const QString &layerId );
358 
364  SERVER_EXPORT QStringList wfstUpdateLayerIds( const QgsProject &project );
365 
371  SERVER_EXPORT QStringList wfstInsertLayerIds( const QgsProject &project );
372 
378  SERVER_EXPORT QStringList wfstDeleteLayerIds( const QgsProject &project );
379 
385  SERVER_EXPORT QString wcsServiceUrl( const QgsProject &project );
386 
392  SERVER_EXPORT QStringList wcsLayerIds( const QgsProject &project );
393 
400  SERVER_EXPORT QString wmtsServiceUrl( const QgsProject &project );
401 };
402 
403 #endif
QgsServerProjectUtils::wmsMaxAtlasFeatures
SERVER_EXPORT int wmsMaxAtlasFeatures(const QgsProject &project)
Returns the maximum number of atlas features which can be printed in a request.
Definition: qgsserverprojectutils.cpp:140
QgsServerProjectUtils::wmsFeatureInfoDocumentElementNs
SERVER_EXPORT QString wmsFeatureInfoDocumentElementNs(const QgsProject &project)
Returns the document element namespace for XML GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:184
QgsServerProjectUtils::wcsServiceUrl
SERVER_EXPORT QString wcsServiceUrl(const QgsProject &project)
Returns the WCS service url defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:362
QgsServerProjectUtils::wmsFeatureInfoSegmentizeWktGeometry
SERVER_EXPORT bool wmsFeatureInfoSegmentizeWktGeometry(const QgsProject &project)
Returns if the geometry has to be segmentize in GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:166
QgsServerProjectUtils::wmtsServiceUrl
SERVER_EXPORT QString wmtsServiceUrl(const QgsProject &project)
Returns the WMTS service url defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:372
QgsServerProjectUtils::ceilWithPrecision
SERVER_EXPORT double ceilWithPrecision(double number, int places)
Returns a double greater than number to the specified number of places.
Definition: qgsserverprojectutils.cpp:21
qgsserverprojectutils.h
QgsServerProjectUtils::wmsFeatureInfoLayerAliasMap
SERVER_EXPORT QHash< QString, QString > wmsFeatureInfoLayerAliasMap(const QgsProject &project)
Returns the mapping between layer name and wms layer name for GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:194
QgsServerProjectUtils
The QgsServerProjectUtils namespace provides a way to retrieve specific entries from a QgsProject.
Definition: qgsserverprojectutils.h:45
QgsServerProjectUtils::wmsServiceUrl
SERVER_EXPORT QString wmsServiceUrl(const QgsProject &project)
Returns the WMS service url defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:301
QgsServerProjectUtils::wfstInsertLayerIds
SERVER_EXPORT QStringList wfstInsertLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities.
Definition: qgsserverprojectutils.cpp:352
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsServerProjectUtils::wcsLayerIds
SERVER_EXPORT QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
Definition: qgsserverprojectutils.cpp:367
QgsServerProjectUtils::owsServiceContactPosition
SERVER_EXPORT QString owsServiceContactPosition(const QgsProject &project)
Returns the owsService contact position defined in project.
Definition: qgsserverprojectutils.cpp:85
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:95
QgsServerProjectUtils::wmsInspireTemporalReference
SERVER_EXPORT QString wmsInspireTemporalReference(const QgsProject &project)
Returns the Inspire temporal reference.
Definition: qgsserverprojectutils.cpp:241
QgsServerProjectUtils::wfsServiceUrl
SERVER_EXPORT QString wfsServiceUrl(const QgsProject &project)
Returns the WFS service url defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:332
QgsServerProjectUtils::wmsFeatureInfoDocumentElement
SERVER_EXPORT QString wmsFeatureInfoDocumentElement(const QgsProject &project)
Returns the document element name for XML GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:179
QgsServerProjectUtils::wmsUseLayerIds
SERVER_EXPORT bool wmsUseLayerIds(const QgsProject &project)
Returns if layer ids are used as name in WMS.
Definition: qgsserverprojectutils.cpp:125
QgsServerProjectUtils::wmsInspireMetadataUrl
SERVER_EXPORT QString wmsInspireMetadataUrl(const QgsProject &project)
Returns the Inspire metadata URL.
Definition: qgsserverprojectutils.cpp:231
QgsServerProjectUtils::wmsInspireLanguage
SERVER_EXPORT QString wmsInspireLanguage(const QgsProject &project)
Returns the Inspire language.
Definition: qgsserverprojectutils.cpp:226
QgsServerProjectUtils::wmsOutputCrsList
SERVER_EXPORT QStringList wmsOutputCrsList(const QgsProject &project)
Returns the WMS output CRS list.
Definition: qgsserverprojectutils.cpp:256
QgsServerProjectUtils::wmsFeatureInfoPrecision
SERVER_EXPORT int wmsFeatureInfoPrecision(const QgsProject &project)
Returns the geometry precision for GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:174
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsServerProjectUtils::wmsMaxHeight
SERVER_EXPORT int wmsMaxHeight(const QgsProject &project)
Returns the maximum height for WMS images defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:120
QgsServerProjectUtils::wfsLayerIds
SERVER_EXPORT QStringList wfsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WFS.
Definition: qgsserverprojectutils.cpp:337
QgsServerProjectUtils::wfstDeleteLayerIds
SERVER_EXPORT QStringList wfstDeleteLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities.
Definition: qgsserverprojectutils.cpp:357
QgsServerProjectUtils::owsServiceContactOrganization
SERVER_EXPORT QString owsServiceContactOrganization(const QgsProject &project)
Returns the owsService contact organization defined in project.
Definition: qgsserverprojectutils.cpp:80
QgsServerProjectUtils::wmsTileBuffer
SERVER_EXPORT int wmsTileBuffer(const QgsProject &project)
Returns the tile buffer in pixels for WMS images defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:135
QgsServerProjectUtils::owsServiceContactMail
SERVER_EXPORT QString owsServiceContactMail(const QgsProject &project)
Returns the owsService contact mail defined in project.
Definition: qgsserverprojectutils.cpp:95
QgsServerProjectUtils::wmsInspireActivate
SERVER_EXPORT bool wmsInspireActivate(const QgsProject &project)
Returns if Inspire is activated.
Definition: qgsserverprojectutils.cpp:221
QgsServerProjectUtils::floorWithPrecision
SERVER_EXPORT double floorWithPrecision(double number, int places)
Returns a double less than number to the specified number of places.
Definition: qgsserverprojectutils.cpp:27
QgsServerProjectUtils::wmsRestrictedLayers
SERVER_EXPORT QStringList wmsRestrictedLayers(const QgsProject &project)
Returns the restricted layer name list.
Definition: qgsserverprojectutils.cpp:311
qgis_sip.h
QgsServerProjectUtils::wmsFeatureInfoAddWktGeometry
SERVER_EXPORT bool wmsFeatureInfoAddWktGeometry(const QgsProject &project)
Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:158
QgsServerProjectUtils::wmsExtent
SERVER_EXPORT QgsRectangle wmsExtent(const QgsProject &project)
Returns the WMS Extent restriction.
Definition: qgsserverprojectutils.cpp:316
QgsServerProjectUtils::wfsLayerPrecision
SERVER_EXPORT int wfsLayerPrecision(const QgsProject &project, const QString &layerId)
Returns the Layer precision defined in a QGIS project for the WFS GetFeature.
Definition: qgsserverprojectutils.cpp:342
QgsServerProjectUtils::wmsMaxWidth
SERVER_EXPORT int wmsMaxWidth(const QgsProject &project)
Returns the maximum width for WMS images defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:115
QgsServerProjectUtils::wmsFeatureInfoSchema
SERVER_EXPORT QString wmsFeatureInfoSchema(const QgsProject &project)
Returns the schema URL for XML GetFeatureInfo request.
Definition: qgsserverprojectutils.cpp:189
QgsServerProjectUtils::owsServiceCapabilities
SERVER_EXPORT bool owsServiceCapabilities(const QgsProject &project)
Returns if owsService capabilities are enabled.
Definition: qgsserverprojectutils.cpp:33
QgsServerProjectUtils::wmsRootName
SERVER_EXPORT QString wmsRootName(const QgsProject &project)
Returns the WMS root layer name defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:306
QgsServerProjectUtils::wmsDefaultMapUnitsPerMm
SERVER_EXPORT double wmsDefaultMapUnitsPerMm(const QgsProject &project)
Returns the default number of map units per millimeters in case of the scale is not given.
Definition: qgsserverprojectutils.cpp:145
QgsServerProjectUtils::wmsImageQuality
SERVER_EXPORT int wmsImageQuality(const QgsProject &project)
Returns the quality for WMS images defined in a QGIS project.
Definition: qgsserverprojectutils.cpp:130
QgsServerProjectUtils::owsServiceAccessConstraints
SERVER_EXPORT QString owsServiceAccessConstraints(const QgsProject &project)
Returns the owsService access constraints defined in project.
Definition: qgsserverprojectutils.cpp:110
QgsServerProjectUtils::owsServiceContactPhone
SERVER_EXPORT QString owsServiceContactPhone(const QgsProject &project)
Returns the owsService contact phone defined in project.
Definition: qgsserverprojectutils.cpp:100
QgsServerProjectUtils::wmsRestrictedComposers
SERVER_EXPORT QStringList wmsRestrictedComposers(const QgsProject &project)
Returns the restricted composer list.
Definition: qgsserverprojectutils.cpp:251
QgsServerProjectUtils::wmsInfoFormatSia2045
SERVER_EXPORT bool wmsInfoFormatSia2045(const QgsProject &project)
Returns if the info format is SIA20145.
Definition: qgsserverprojectutils.cpp:150
QgsServerProjectUtils::wfstUpdateLayerIds
SERVER_EXPORT QStringList wfstUpdateLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities.
Definition: qgsserverprojectutils.cpp:347
QgsServerProjectUtils::wmsInspireMetadataDate
SERVER_EXPORT QString wmsInspireMetadataDate(const QgsProject &project)
Returns the Inspire metadata date.
Definition: qgsserverprojectutils.cpp:246
QgsServerProjectUtils::owsServiceKeywords
SERVER_EXPORT QStringList owsServiceKeywords(const QgsProject &project)
Returns the owsService keywords defined in project.
Definition: qgsserverprojectutils.cpp:48
QgsServerProjectUtils::owsServiceFees
SERVER_EXPORT QString owsServiceFees(const QgsProject &project)
Returns the owsService fees defined in project.
Definition: qgsserverprojectutils.cpp:105
QgsServerProjectUtils::owsServiceContactPerson
SERVER_EXPORT QString owsServiceContactPerson(const QgsProject &project)
Returns the owsService contact person defined in project.
Definition: qgsserverprojectutils.cpp:90
QgsServerProjectUtils::wmsInspireMetadataUrlType
SERVER_EXPORT QString wmsInspireMetadataUrlType(const QgsProject &project)
Returns the Inspire metadata URL type.
Definition: qgsserverprojectutils.cpp:236
QgsServerProjectUtils::owsServiceTitle
SERVER_EXPORT QString owsServiceTitle(const QgsProject &project)
Returns the owsService title defined in project.
Definition: qgsserverprojectutils.cpp:38
QgsServerProjectUtils::owsServiceOnlineResource
SERVER_EXPORT QString owsServiceOnlineResource(const QgsProject &project)
Returns the owsService online resource defined in project.
Definition: qgsserverprojectutils.cpp:66
QgsServerProjectUtils::owsServiceAbstract
SERVER_EXPORT QString owsServiceAbstract(const QgsProject &project)
Returns the owsService abstract defined in project.
Definition: qgsserverprojectutils.cpp:43