QGIS API Documentation 3.99.0-Master (d270888f95f)
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
170 || sia2045.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
171}
172
174{
175 const QString wktGeom = project.readEntry( u"WMSAddWktGeometry"_s, u"/"_s, "" );
176
177 return wktGeom.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0
178 || wktGeom.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
179}
180
182{
183 const QString useFormSettings = project.readEntry( u"WMSFeatureInfoUseAttributeFormSettings"_s, u"/"_s, "" );
184 return useFormSettings.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0
185 || useFormSettings.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
186}
187
189{
190 const QString useFormSettings = project.readEntry( u"WMSHTMLFeatureInfoUseOnlyMaptip"_s, u"/"_s, "" );
191 return useFormSettings.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
192}
193
195{
196 const QString segmGeom = project.readEntry( u"WMSSegmentizeFeatureInfoGeometry"_s, u"/"_s, "" );
197
198 return segmGeom.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0
199 || segmGeom.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
200}
201
203{
204 const QString legendGroups = project.readEntry( u"WMSAddLayerGroupsLegendGraphic"_s, u"/"_s, "" );
205 return legendGroups.compare( "enabled"_L1, Qt::CaseInsensitive ) == 0
206 || legendGroups.compare( "true"_L1, Qt::CaseInsensitive ) == 0;
207}
208
210{
211 return project.readBoolEntry( u"WMSSkipNameForGroup"_s, u"/"_s, false );
212}
213
215{
216 return project.readNumEntry( u"WMSPrecision"_s, u"/"_s, 6 );
217}
218
220{
221 return project.readEntry( u"WMSFeatureInfoDocumentElement"_s, u"/"_s, "" );
222}
223
225{
226 return project.readEntry( u"WMSFeatureInfoDocumentElementNS"_s, u"/"_s, "" );
227}
228
230{
231 return project.readEntry( u"WMSFeatureInfoSchema"_s, u"/"_s, "" );
232}
233
234QHash<QString, QString> QgsServerProjectUtils::wmsFeatureInfoLayerAliasMap( const QgsProject &project )
235{
236 QHash<QString, QString> aliasMap;
237
238 //WMSFeatureInfoAliasLayers
239 const QStringList aliasLayerStringList = project.readListEntry( u"WMSFeatureInfoAliasLayers"_s, u"/value"_s, QStringList() );
240 if ( aliasLayerStringList.isEmpty() )
241 {
242 return aliasMap;
243 }
244
245 //WMSFeatureInfoLayerAliases
246 const QStringList layerAliasStringList = project.readListEntry( u"WMSFeatureInfoLayerAliases"_s, u"/value"_s, QStringList() );
247 if ( layerAliasStringList.isEmpty() )
248 {
249 return aliasMap;
250 }
251
252 const int nMapEntries = std::min( aliasLayerStringList.size(), layerAliasStringList.size() );
253 for ( int i = 0; i < nMapEntries; ++i )
254 {
255 aliasMap.insert( aliasLayerStringList.at( i ), layerAliasStringList.at( i ) );
256 }
257
258 return aliasMap;
259}
260
262{
263 return project.readBoolEntry( u"WMSInspire"_s, u"/activated"_s );
264}
265
267{
268 return project.readEntry( u"WMSInspire"_s, u"/language"_s );
269}
270
272{
273 return project.readEntry( u"WMSInspire"_s, u"/metadataUrl"_s );
274}
275
277{
278 return project.readEntry( u"WMSInspire"_s, u"/metadataUrlType"_s );
279}
280
282{
283 return project.readEntry( u"WMSInspire"_s, u"/temporalReference"_s );
284}
285
287{
288 return project.readEntry( u"WMSInspire"_s, u"/metadataDate"_s );
289}
290
292{
293 return project.readListEntry( u"WMSRestrictedComposers"_s, u"/"_s, QStringList() );
294}
295
297{
298 QStringList crsList;
299 const QStringList wmsCrsList = project.readListEntry( u"WMSCrsList"_s, u"/"_s, QStringList() );
300 if ( !wmsCrsList.isEmpty() )
301 {
302 for ( const auto &crs : std::as_const( wmsCrsList ) )
303 {
304 if ( !crs.isEmpty() )
305 {
306 crsList.append( crs );
307 }
308 }
309 }
310 if ( crsList.isEmpty() )
311 {
312 const QStringList valueList = project.readListEntry( u"WMSEpsgList"_s, u"/"_s, QStringList() );
313 bool conversionOk;
314 for ( const auto &espgStr : valueList )
315 {
316 const int epsgNr = espgStr.toInt( &conversionOk );
317 if ( conversionOk )
318 {
319 crsList.append( u"EPSG:%1"_s.arg( epsgNr ) );
320 }
321 }
322 }
323 if ( crsList.isEmpty() )
324 {
325 //no CRS restriction defined in the project. Provide project CRS, wgs84 and pseudo mercator
326 const QString projectCrsId = project.crs().authid();
327 crsList.append( projectCrsId );
328 if ( projectCrsId.compare( "EPSG:4326"_L1, Qt::CaseInsensitive ) != 0 )
329 {
330 crsList.append( u"EPSG:%1"_s.arg( 4326 ) );
331 }
332 if ( projectCrsId.compare( "EPSG:3857"_L1, Qt::CaseInsensitive ) != 0 )
333 {
334 crsList.append( u"EPSG:%1"_s.arg( 3857 ) );
335 }
336 }
337 return crsList;
338}
339
341{
342 const QStringList crsList = wmsOutputCrsList( project );
343 QStringList crsListAsOgcUrn;
344 for ( const QString &crsString : crsList )
345 {
346 crsListAsOgcUrn.append( QgsCoordinateReferenceSystem::fromOgcWmsCrs( crsString ).toOgcUrn() );
347 }
348
349 return crsListAsOgcUrn;
350}
351
352QString QgsServerProjectUtils::serviceUrl( const QString &service, const QgsServerRequest &request, const QgsServerSettings &settings )
353{
354 const QString serviceUpper = service.toUpper();
355 QString url = settings.serviceUrl( serviceUpper );
356 if ( !url.isEmpty() )
357 {
358 return url;
359 }
360
362 if ( serviceUpper == "WMS"_L1 )
363 {
365 }
366 else if ( serviceUpper == "WFS"_L1 )
367 {
369 }
370 else if ( serviceUpper == "WCS"_L1 )
371 {
373 }
374 else if ( serviceUpper == "WMTS"_L1 )
375 {
377 }
378 url = request.header( header );
379 if ( !url.isEmpty() )
380 {
381 return url;
382 }
384 if ( !url.isEmpty() )
385 {
386 return url;
387 }
388
389 QString proto;
390 QString host;
391
392 QString forwarded = request.header( QgsServerRequest::FORWARDED );
393 if ( !forwarded.isEmpty() )
394 {
395 forwarded = forwarded.split( ','_L1 )[0];
396 const QStringList elements = forwarded.split( ';' );
397 for ( const QString &element : elements )
398 {
399 QStringList splited_element = element.trimmed().split( '='_L1 );
400 if ( splited_element[0] == "host" )
401 {
402 host = splited_element[1];
403 }
404 if ( splited_element[0] == "proto" )
405 {
406 proto = splited_element[1];
407 }
408 }
409 }
410
411 if ( host.isEmpty() )
412 {
415 }
416
417 if ( host.isEmpty() )
418 {
420 }
421
422 QUrl urlQUrl = request.baseUrl();
423 if ( !proto.isEmpty() )
424 {
425 urlQUrl.setScheme( proto );
426 }
427
428 if ( !host.isEmpty() )
429 {
430 QStringList hostPort = host.split( ':'_L1 );
431 if ( hostPort.length() == 1 )
432 {
433 urlQUrl.setHost( hostPort[0] );
434 urlQUrl.setPort( -1 );
435 }
436 if ( hostPort.length() == 2 )
437 {
438 urlQUrl.setHost( hostPort[0] );
439 urlQUrl.setPort( hostPort[1].toInt() );
440 }
441 }
442
443 // https://docs.qgis.org/3.16/en/docs/server_manual/services.html#wms-map
444 const QUrlQuery query { request.originalUrl().query() };
445 const QList<QPair<QString, QString>> constItems { query.queryItems() };
446 QString map;
447 for ( const QPair<QString, QString> &item : std::as_const( constItems ) )
448 {
449 if ( 0 == item.first.compare( "MAP"_L1, Qt::CaseSensitivity::CaseInsensitive ) )
450 {
451 map = item.second;
452 break;
453 }
454 }
455
456 if ( !map.isEmpty() )
457 {
458 QUrlQuery query;
459 query.setQueryItems( { { "MAP", map } } );
460 urlQUrl.setQuery( query );
461 }
462 else
463 {
464 urlQUrl.setQuery( nullptr );
465 }
466
467 return urlQUrl.url();
468}
469
470QString QgsServerProjectUtils::wmsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
471{
472 QString url = project.readEntry( u"WMSUrl"_s, u"/"_s, "" );
473 if ( url.isEmpty() )
474 {
475 url = serviceUrl( u"WMS"_s, request, settings );
476 }
477 return url;
478}
479
481{
482 return project.readEntry( u"WMSRootName"_s, u"/"_s, "" );
483}
484
486{
487 return project.readListEntry( u"WMSRestrictedLayers"_s, u"/"_s, QStringList() );
488}
489
491{
492 bool ok = false;
493 QStringList values = project.readListEntry( u"WMSExtent"_s, u"/"_s, QStringList(), &ok );
494 if ( !ok || values.size() != 4 )
495 {
496 return QgsRectangle();
497 }
498 //order of value elements must be xmin, ymin, xmax, ymax
499 const double xmin = values[0].toDouble();
500 const double ymin = values[1].toDouble();
501 const double xmax = values[2].toDouble();
502 const double ymax = values[3].toDouble();
503 return QgsRectangle( xmin, ymin, xmax, ymax );
504}
505
506QString QgsServerProjectUtils::wfsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
507{
508 QString url = project.readEntry( u"WFSUrl"_s, u"/"_s, "" );
509 if ( url.isEmpty() )
510 {
511 url = serviceUrl( u"WFS"_s, request, settings );
512 }
513 return url;
514}
515
517{
518 return project.readListEntry( u"WFSLayers"_s, u"/"_s );
519}
520
521int QgsServerProjectUtils::wfsLayerPrecision( const QgsProject &project, const QString &layerId )
522{
523 return project.readNumEntry( u"WFSLayersPrecision"_s, "/" + layerId, 6 );
524}
525
527{
528 return project.readListEntry( u"WFSTLayers"_s, u"Update"_s );
529}
530
532{
533 return project.readListEntry( u"WFSTLayers"_s, u"Insert"_s );
534}
535
537{
538 return project.readListEntry( u"WFSTLayers"_s, u"Delete"_s );
539}
540
541QString QgsServerProjectUtils::wcsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
542{
543 QString url = project.readEntry( u"WCSUrl"_s, u"/"_s, "" );
544 if ( url.isEmpty() )
545 {
546 url = serviceUrl( u"WCS"_s, request, settings );
547 }
548 return url;
549}
550
552{
553 return project.readListEntry( u"WCSLayers"_s, u"/"_s );
554}
555
556QString QgsServerProjectUtils::wmtsServiceUrl( const QgsProject &project, const QgsServerRequest &request, const QgsServerSettings &settings )
557{
558 QString url = project.readEntry( u"WMTSUrl"_s, u"/"_s, "" );
559 if ( url.isEmpty() )
560 {
561 url = serviceUrl( u"WMTS"_s, request, settings );
562 }
563 return url;
564}
565
567{
568 return project.readBoolEntry( u"RenderMapTile"_s, u"/"_s, false );
569}
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:112
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:115
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:118
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.