QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
Loading...
Searching...
No Matches
qgsserverprojectutils.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsserverprojectutils.cpp
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
19
20#include "qgsmessagelog.h"
21#include "qgsproject.h"
22
23#include <QString>
24
25using namespace Qt::StringLiterals;
26
27double QgsServerProjectUtils::ceilWithPrecision( double number, int places )
28{
29 const double scaleFactor = std::pow( 10.0, places );
30 return ( std::ceil( number * scaleFactor ) / scaleFactor );
31}
32
33double QgsServerProjectUtils::floorWithPrecision( double number, int places )
34{
35 const double scaleFactor = std::pow( 10.0, places );
36 return ( std::floor( number * scaleFactor ) / scaleFactor );
37}
38
40{
41 return project.readBoolEntry( u"WMSServiceCapabilities"_s, u"/"_s, false );
42}
43
45{
46 QString title = project.readEntry( u"WMSServiceTitle"_s, u"/"_s );
47 if ( title.isEmpty() )
48 {
49 title = project.title();
50 }
51 if ( title.isEmpty() )
52 {
53 title = QObject::tr( "Untitled" );
54 }
55 return title;
56}
57
59{
60 return project.readEntry( u"WMSServiceAbstract"_s, u"/"_s );
61}
62
64{
65 QStringList keywordList;
66 const QStringList list = project.readListEntry( u"WMSKeywordList"_s, u"/"_s, QStringList() );
67 if ( !list.isEmpty() )
68 {
69 for ( int i = 0; i < list.size(); ++i )
70 {
71 const QString keyword = list.at( i );
72 if ( !keyword.isEmpty() )
73 {
74 keywordList.append( keyword );
75 }
76 }
77 }
78 return keywordList;
79}
80
82{
83 QString wmsOnlineResource = project.readEntry( u"WMSOnlineResource"_s, u"/"_s );
84
86 if ( wmsOnlineResourceProperty.isActive() && !wmsOnlineResourceProperty.expressionString().isEmpty() )
87 {
88 const QgsExpressionContext context = project.createExpressionContext();
89 return wmsOnlineResourceProperty.valueAsString( context, wmsOnlineResource );
90 }
91
92 return wmsOnlineResource;
93}
94
96{
97 return project.readEntry( u"WMSContactOrganization"_s, u"/"_s );
98}
99
101{
102 return project.readEntry( u"WMSContactPosition"_s, u"/"_s );
103}
104
106{
107 return project.readEntry( u"WMSContactPerson"_s, u"/"_s );
108}
109
111{
112 return project.readEntry( u"WMSContactMail"_s, u"/"_s );
113}
114
116{
117 return project.readEntry( u"WMSContactPhone"_s, u"/"_s );
118}
119
121{
122 return project.readEntry( u"WMSFees"_s, u"/"_s );
123}
124
126{
127 return project.readEntry( u"WMSAccessConstraints"_s, u"/"_s );
128}
129
131{
132 return project.readNumEntry( u"WMSMaxWidth"_s, u"/"_s, -1 );
133}
134
136{
137 return project.readNumEntry( u"WMSMaxHeight"_s, u"/"_s, -1 );
138}
139
141{
142 return project.readBoolEntry( u"WMSUseLayerIDs"_s, u"/"_s, false );
143}
144
146{
147 return project.readNumEntry( u"WMSImageQuality"_s, u"/"_s, -1 );
148}
149
151{
152 return project.readNumEntry( u"WMSTileBuffer"_s, u"/"_s, 0 );
153}
154
156{
157 return project.readNumEntry( u"WMSMaxAtlasFeatures"_s, u"/"_s, 1 );
158}
159
161{
162 return project.readDoubleEntry( u"WMSDefaultMapUnitsPerMm"_s, u"/"_s, 1 );
163}
164
166{
167 const QString sia2045 = project.readEntry( u"WMSInfoFormatSIA2045"_s, u"/"_s, "" );
168
169 return sia2045.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0 || sia2045.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
170}
171
173{
174 const QString wktGeom = project.readEntry( u"WMSAddWktGeometry"_s, u"/"_s, "" );
175
176 return wktGeom.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0 || wktGeom.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
177}
178
180{
181 const QString useFormSettings = project.readEntry( u"WMSFeatureInfoUseAttributeFormSettings"_s, u"/"_s, "" );
182 return useFormSettings.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0 || useFormSettings.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
183}
184
186{
187 const QString useFormSettings = project.readEntry( u"WMSHTMLFeatureInfoUseOnlyMaptip"_s, u"/"_s, "" );
188 return useFormSettings.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
189}
190
192{
193 const QString segmGeom = project.readEntry( u"WMSSegmentizeFeatureInfoGeometry"_s, u"/"_s, "" );
194
195 return segmGeom.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0 || segmGeom.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
196}
197
199{
200 const QString legendGroups = project.readEntry( u"WMSAddLayerGroupsLegendGraphic"_s, u"/"_s, "" );
201 return legendGroups.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0 || legendGroups.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
202}
203
205{
206 return project.readBoolEntry( u"WMSSkipNameForGroup"_s, u"/"_s, false );
207}
208
210{
211 return project.readNumEntry( u"WMSPrecision"_s, u"/"_s, 6 );
212}
213
215{
216 return project.readEntry( u"WMSFeatureInfoDocumentElement"_s, u"/"_s, "" );
217}
218
220{
221 return project.readEntry( u"WMSFeatureInfoDocumentElementNS"_s, u"/"_s, "" );
222}
223
225{
226 return project.readEntry( u"WMSFeatureInfoSchema"_s, u"/"_s, "" );
227}
228
229QHash<QString, QString> QgsServerProjectUtils::wmsFeatureInfoLayerAliasMap( const QgsProject &project )
230{
231 QHash<QString, QString> aliasMap;
232
233 //WMSFeatureInfoAliasLayers
234 const QStringList aliasLayerStringList = project.readListEntry( u"WMSFeatureInfoAliasLayers"_s, u"/value"_s, QStringList() );
235 if ( aliasLayerStringList.isEmpty() )
236 {
237 return aliasMap;
238 }
239
240 //WMSFeatureInfoLayerAliases
241 const QStringList layerAliasStringList = project.readListEntry( u"WMSFeatureInfoLayerAliases"_s, u"/value"_s, QStringList() );
242 if ( layerAliasStringList.isEmpty() )
243 {
244 return aliasMap;
245 }
246
247 const int nMapEntries = std::min( aliasLayerStringList.size(), layerAliasStringList.size() );
248 for ( int i = 0; i < nMapEntries; ++i )
249 {
250 aliasMap.insert( aliasLayerStringList.at( i ), layerAliasStringList.at( i ) );
251 }
252
253 return aliasMap;
254}
255
257{
258 return project.readBoolEntry( u"WMSInspire"_s, u"/activated"_s );
259}
260
262{
263 return project.readEntry( u"WMSInspire"_s, u"/language"_s );
264}
265
267{
268 return project.readEntry( u"WMSInspire"_s, u"/metadataUrl"_s );
269}
270
272{
273 return project.readEntry( u"WMSInspire"_s, u"/metadataUrlType"_s );
274}
275
277{
278 return project.readEntry( u"WMSInspire"_s, u"/temporalReference"_s );
279}
280
282{
283 return project.readEntry( u"WMSInspire"_s, u"/metadataDate"_s );
284}
285
287{
288 return project.readListEntry( u"WMSRestrictedComposers"_s, u"/"_s, QStringList() );
289}
290
292{
293 QStringList crsList;
294 const QStringList wmsCrsList = project.readListEntry( u"WMSCrsList"_s, u"/"_s, QStringList() );
295 if ( !wmsCrsList.isEmpty() )
296 {
297 for ( const auto &crs : std::as_const( wmsCrsList ) )
298 {
299 if ( !crs.isEmpty() )
300 {
301 crsList.append( crs );
302 }
303 }
304 }
305 if ( crsList.isEmpty() )
306 {
307 const QStringList valueList = project.readListEntry( u"WMSEpsgList"_s, u"/"_s, QStringList() );
308 bool conversionOk;
309 for ( const auto &espgStr : valueList )
310 {
311 const int epsgNr = espgStr.toInt( &conversionOk );
312 if ( conversionOk )
313 {
314 crsList.append( u"EPSG:%1"_s.arg( epsgNr ) );
315 }
316 }
317 }
318 if ( crsList.isEmpty() )
319 {
320 //no CRS restriction defined in the project. Provide project CRS, wgs84 and pseudo mercator
321 const QString projectCrsId = project.crs().authid();
322 crsList.append( projectCrsId );
323 if ( projectCrsId.compare( "EPSG:4326"_L1, Qt::CaseInsensitive ) != 0 )
324 {
325 crsList.append( u"EPSG:%1"_s.arg( 4326 ) );
326 }
327 if ( projectCrsId.compare( "EPSG:3857"_L1, Qt::CaseInsensitive ) != 0 )
328 {
329 crsList.append( u"EPSG:%1"_s.arg( 3857 ) );
330 }
331 }
332 return crsList;
333}
334
336{
337 const QStringList crsList = wmsOutputCrsList( project );
338 QStringList crsListAsOgcUrn;
339 for ( const QString &crsString : crsList )
340 {
341 crsListAsOgcUrn.append( QgsCoordinateReferenceSystem::fromOgcWmsCrs( crsString ).toOgcUrn() );
342 }
343
344 return crsListAsOgcUrn;
345}
346
347QString QgsServerProjectUtils::serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings )
348{
349 const QString serviceUpper = service.toUpper();
350 QString url = settings.serviceUrl( serviceUpper );
351 if ( !url.isEmpty() )
352 {
353 return url;
354 }
355
357 if ( serviceUpper == "WMS"_L1 )
358 {
360 }
361 else if ( serviceUpper == "WFS"_L1 )
362 {
364 }
365 else if ( serviceUpper == "WCS"_L1 )
366 {
368 }
369 else if ( serviceUpper == "WMTS"_L1 )
370 {
372 }
373 url = request.header( header );
374 if ( !url.isEmpty() )
375 {
376 return url;
377 }
379 if ( !url.isEmpty() )
380 {
381 return url;
382 }
383
384 QString proto;
385 QString host;
386
387 QString forwarded = request.header( QgsServerRequest::FORWARDED );
388 if ( !forwarded.isEmpty() )
389 {
390 forwarded = forwarded.split( ','_L1 )[0];
391 const QStringList elements = forwarded.split( ';' );
392 for ( const QString &element : elements )
393 {
394 QStringList splited_element = element.trimmed().split( '='_L1 );
395 if ( splited_element[0] == "host" )
396 {
397 host = splited_element[1];
398 }
399 if ( splited_element[0] == "proto" )
400 {
401 proto = splited_element[1];
402 }
403 }
404 }
405
406 if ( host.isEmpty() )
407 {
410 }
411
412 if ( host.isEmpty() )
413 {
415 }
416
417 QUrl urlQUrl = request.baseUrl();
418 if ( !proto.isEmpty() )
419 {
420 urlQUrl.setScheme( proto );
421 }
422
423 if ( !host.isEmpty() )
424 {
425 QStringList hostPort = host.split( ':'_L1 );
426 if ( hostPort.length() == 1 )
427 {
428 urlQUrl.setHost( hostPort[0] );
429 urlQUrl.setPort( -1 );
430 }
431 if ( hostPort.length() == 2 )
432 {
433 urlQUrl.setHost( hostPort[0] );
434 urlQUrl.setPort( hostPort[1].toInt() );
435 }
436 }
437
438 // https://docs.qgis.org/3.16/en/docs/server_manual/services.html#wms-map
439 const QUrlQuery query { request.originalUrl().query() };
440 const QList<QPair<QString, QString>> constItems { query.queryItems() };
441 QString map;
442 for ( const QPair<QString, QString> &item : std::as_const( constItems ) )
443 {
444 if ( 0 == item.first.compare( "MAP"_L1, Qt::CaseSensitivity::CaseInsensitive ) )
445 {
446 map = item.second;
447 break;
448 }
449 }
450
451 if ( !map.isEmpty() )
452 {
453 QUrlQuery query;
454 query.setQueryItems( { { "MAP", map } } );
455 urlQUrl.setQuery( query );
456 }
457 else
458 {
459 urlQUrl.setQuery( nullptr );
460 }
461
462 return urlQUrl.url();
463}
464
465QString QgsServerProjectUtils::wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
466{
467 QString url = project.readEntry( u"WMSUrl"_s, u"/"_s, "" );
468 if ( url.isEmpty() )
469 {
470 url = serviceUrl( u"WMS"_s, request, settings );
471 }
472 return url;
473}
474
476{
477 return project.readEntry( u"WMSRootName"_s, u"/"_s, "" );
478}
479
481{
482 return project.readListEntry( u"WMSRestrictedLayers"_s, u"/"_s, QStringList() );
483}
484
486{
487 bool ok = false;
488 QStringList values = project.readListEntry( u"WMSExtent"_s, u"/"_s, QStringList(), &ok );
489 if ( !ok || values.size() != 4 )
490 {
491 return QgsRectangle();
492 }
493 //order of value elements must be xmin, ymin, xmax, ymax
494 const double xmin = values[0].toDouble();
495 const double ymin = values[1].toDouble();
496 const double xmax = values[2].toDouble();
497 const double ymax = values[3].toDouble();
498 return QgsRectangle( xmin, ymin, xmax, ymax );
499}
500
501QString QgsServerProjectUtils::wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
502{
503 QString url = project.readEntry( u"WFSUrl"_s, u"/"_s, "" );
504 if ( url.isEmpty() )
505 {
506 url = serviceUrl( u"WFS"_s, request, settings );
507 }
508 return url;
509}
510
512{
513 return project.readListEntry( u"WFSLayers"_s, u"/"_s );
514}
515
516int QgsServerProjectUtils::wfsLayerPrecision( const QgsProject &project, const QString &layerId )
517{
518 return project.readNumEntry( u"WFSLayersPrecision"_s, "/" + layerId, 6 );
519}
520
522{
523 return project.readListEntry( u"WFSTLayers"_s, u"Update"_s );
524}
525
527{
528 return project.readListEntry( u"WFSTLayers"_s, u"Insert"_s );
529}
530
532{
533 return project.readListEntry( u"WFSTLayers"_s, u"Delete"_s );
534}
535
536QString QgsServerProjectUtils::wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
537{
538 QString url = project.readEntry( u"WCSUrl"_s, u"/"_s, "" );
539 if ( url.isEmpty() )
540 {
541 url = serviceUrl( u"WCS"_s, request, settings );
542 }
543 return url;
544}
545
547{
548 return project.readListEntry( u"WCSLayers"_s, u"/"_s );
549}
550
551QString QgsServerProjectUtils::wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
552{
553 QString url = project.readEntry( u"WMTSUrl"_s, u"/"_s, "" );
554 if ( url.isEmpty() )
555 {
556 url = serviceUrl( u"WMTS"_s, request, settings );
557 }
558 return url;
559}
560
562{
563 return project.readBoolEntry( u"RenderMapTile"_s, u"/"_s, false );
564}
static QgsCoordinateReferenceSystem fromOgcWmsCrs(const QString &ogcCrs)
Creates a CRS from a given OGC WMS-format Coordinate Reference System string.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:113
int readNumEntry(const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
Reads an integer from the specified scope and key.
QString title
Definition qgsproject.h:116
QgsPropertyCollection dataDefinedServerProperties() const
Returns the data defined properties used for overrides in user defined server parameters.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QString readEntry(const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
Reads a string from the specified scope and key.
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
Reads a boolean from the specified scope and key.
QgsCoordinateReferenceSystem crs
Definition qgsproject.h:119
double readDoubleEntry(const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
Reads a double from the specified scope and key.
QStringList readListEntry(const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
Reads a string list from the specified scope and key.
QgsProperty property(int key) const final
Returns a matching property from the collection, if one exists.
A store for object properties.
QString expressionString() const
Returns the expression used for the property value.
QString valueAsString(const QgsExpressionContext &context, const QString &defaultString=QString(), bool *ok=nullptr) const
Calculates the current value of the property and interprets it as a string.
bool isActive() const
Returns whether the property is currently active.
A rectangle specified with double values.
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.
virtual QString header(const QString &name) const
Returns the header value.
QUrl baseUrl() const
Returns the base URL of QGIS server.
QUrl originalUrl() const
Returns the request url as seen by the web server, by default this is equal to the url seen by QGIS s...
RequestHeader
The internal HTTP Header used for the request as enum.
@ X_QGIS_WMS_SERVICE_URL
The QGIS WMS service URL.
@ X_QGIS_WCS_SERVICE_URL
The QGIS WCS service URL.
@ X_QGIS_WFS_SERVICE_URL
The QGIS WFS service URL.
@ X_FORWARDED_PROTO
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto.
@ X_QGIS_WMTS_SERVICE_URL
The QGIS WMTS service URL.
@ X_QGIS_SERVICE_URL
The QGIS service URL.
@ X_FORWARDED_HOST
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host.
@ FORWARDED
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded, https://tools....
@ HOST
Https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host.
Provides a way to retrieve settings by prioritizing according to environment variables,...
QString serviceUrl(const QString &service) const
Returns the service URL from the setting.