Class: QgsServerProjectUtils

class qgis.server.QgsServerProjectUtils

Bases: sip.simplewrapper

Methods

owsServiceAbstract

Returns the owsService abstract defined in project.

owsServiceAccessConstraints

Returns the owsService access constraints defined in project.

owsServiceCapabilities

Returns if owsService capabilities are enabled.

owsServiceContactMail

Returns the owsService contact mail defined in project.

owsServiceContactOrganization

Returns the owsService contact organization defined in project.

owsServiceContactPerson

Returns the owsService contact person defined in project.

owsServiceContactPhone

Returns the owsService contact phone defined in project.

owsServiceContactPosition

Returns the owsService contact position defined in project.

owsServiceFees

Returns the owsService fees defined in project.

owsServiceKeywords

Returns the owsService keywords defined in project.

owsServiceOnlineResource

Returns the owsService online resource defined in project.

owsServiceTitle

Returns the owsService title defined in project.

serviceUrl

Returns the service url defined in the environment variable or with HTTP header.

wcsLayerIds

Returns the Layer ids list defined in a QGIS project as published in WCS.

wcsServiceUrl

Returns the WCS service url.

wfsLayerIds

Returns the Layer ids list defined in a QGIS project as published in WFS.

wfsLayerPrecision

Returns the Layer precision defined in a QGIS project for the WFS GetFeature.

wfsServiceUrl

Returns the WFS service url.

wfstDeleteLayerIds

Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities.

wfstInsertLayerIds

Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities.

wfstUpdateLayerIds

Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities.

wmsDefaultMapUnitsPerMm

Returns the default number of map units per millimeters in case of the scale is not given

wmsExtent

Returns the WMS Extent restriction.

wmsFeatureInfoAddWktGeometry

Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.

wmsFeatureInfoDocumentElement

Returns the document element name for XML GetFeatureInfo request.

wmsFeatureInfoDocumentElementNs

Returns the document element namespace for XML GetFeatureInfo request.

wmsFeatureInfoLayerAliasMap

Returns the mapping between layer name and wms layer name for GetFeatureInfo request.

wmsFeatureInfoPrecision

Returns the geometry precision for GetFeatureInfo request.

wmsFeatureInfoSchema

Returns the schema URL for XML GetFeatureInfo request.

wmsFeatureInfoSegmentizeWktGeometry

Returns if the geometry has to be segmentize in GetFeatureInfo request.

wmsFeatureInfoUseAttributeFormSettings

Returns if feature form settings should be considered for the format of the feature info response

wmsImageQuality

Returns the quality for WMS images defined in a QGIS project.

wmsInfoFormatSia2045

Returns if the info format is SIA20145.

wmsInspireActivate

Returns if Inspire is activated.

wmsInspireLanguage

Returns the Inspire language.

wmsInspireMetadataDate

Returns the Inspire metadata date.

wmsInspireMetadataUrl

Returns the Inspire metadata URL.

wmsInspireMetadataUrlType

Returns the Inspire metadata URL type.

wmsInspireTemporalReference

Returns the Inspire temporal reference.

wmsMaxAtlasFeatures

Returns the maximum number of atlas features which can be printed in a request

wmsMaxHeight

Returns the maximum height for WMS images defined in a QGIS project.

wmsMaxWidth

Returns the maximum width for WMS images defined in a QGIS project.

wmsOutputCrsList

Returns the WMS output CRS list.

wmsRenderMapTiles

Returns True if WMS requests should use the QgsMapSettings.RenderMapTile flag, so that no visible artifacts are visible between adjacent tiles.

wmsRestrictedComposers

Returns the restricted composer list.

wmsRestrictedLayers

Returns the restricted layer name list.

wmsRootName

Returns the WMS root layer name defined in a QGIS project.

wmsServiceUrl

Returns the WMS service url.

wmsTileBuffer

Returns the tile buffer in pixels for WMS images defined in a QGIS project.

wmsUseLayerIds

Returns if layer ids are used as name in WMS.

wmtsServiceUrl

Returns the WMTS service url.

owsServiceAbstract(project: QgsProject) str

Returns the owsService abstract defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService abstract if defined in project.

owsServiceAccessConstraints(project: QgsProject) str

Returns the owsService access constraints defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService access constraints if defined in project.

owsServiceCapabilities(project: QgsProject) bool

Returns if owsService capabilities are enabled.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if owsService capabilities are enabled.

owsServiceContactMail(project: QgsProject) str

Returns the owsService contact mail defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService contact mail if defined in project.

owsServiceContactOrganization(project: QgsProject) str

Returns the owsService contact organization defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService contact organization if defined in project.

owsServiceContactPerson(project: QgsProject) str

Returns the owsService contact person defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService contact person if defined in project.

owsServiceContactPhone(project: QgsProject) str

Returns the owsService contact phone defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService contact phone if defined in project.

owsServiceContactPosition(project: QgsProject) str

Returns the owsService contact position defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService contact position if defined in project.

owsServiceFees(project: QgsProject) str

Returns the owsService fees defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService fees if defined in project.

owsServiceKeywords(project: QgsProject) List[str]

Returns the owsService keywords defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the owsService keywords if defined in project.

owsServiceOnlineResource(project: QgsProject) str

Returns the owsService online resource defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService online resource if defined in project.

owsServiceTitle(project: QgsProject) str

Returns the owsService title defined in project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the owsService title if defined in project with project title as fallback, “Untitled” otherwise.

serviceUrl(service: str, request: QgsServerRequest, settings: QgsServerSettings) str

Returns the service url defined in the environment variable or with HTTP header. The is calculated from, in the order:

  • Value defined in the project per service.

  • The <service>_SERVICE_URL environment variable.

  • The SERVICE_URL environment variable.

  • The custom X-Qgis-<service>-Servcie-Url header.

  • The custom X-Qgis-Service-Url header.

  • Build form the standard Forwarded header.

  • Build form the pseudo standard X-Forwarded-Host and X-Forwarded-Proto headers.

  • Build form the standard Host header and the server protocol.

  • Build form the server name and the server protocol.

Parameters:
Return type:

str

Returns:

url to use for this service

New in version 3.20.

wcsLayerIds(project: QgsProject) List[str]

Returns the Layer ids list defined in a QGIS project as published in WCS.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the Layer ids list.

wcsServiceUrl(project: QgsProject, request: QgsServerRequest = QgsServerRequest(), settings: QgsServerSettings = QgsServerSettings()) str

Returns the WCS service url. The URL defined in the project or if not defined the URL from serviceUrl.

Parameters:
Return type:

str

Returns:

url to use for this service

wfsLayerIds(project: QgsProject) List[str]

Returns the Layer ids list defined in a QGIS project as published in WFS.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the Layer ids list.

wfsLayerPrecision(project: QgsProject, layerId: str) int

Returns the Layer precision defined in a QGIS project for the WFS GetFeature.

Parameters:
  • project (QgsProject) – the QGIS project

  • layerId (str) – the layer id in the project

Return type:

int

Returns:

the layer precision for WFS GetFeature.

wfsServiceUrl(project: QgsProject, request: QgsServerRequest = QgsServerRequest(), settings: QgsServerSettings = QgsServerSettings()) str

Returns the WFS service url. The URL defined in the project or if not defined the URL from serviceUrl.

Parameters:
Return type:

str

Returns:

url to use for this service

wfstDeleteLayerIds(project: QgsProject) List[str]

Returns the Layer ids list defined in a QGIS project as published as WFS-T with delete capabilities.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the Layer ids list.

wfstInsertLayerIds(project: QgsProject) List[str]

Returns the Layer ids list defined in a QGIS project as published as WFS-T with insert capabilities.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the Layer ids list.

wfstUpdateLayerIds(project: QgsProject) List[str]

Returns the Layer ids list defined in a QGIS project as published as WFS-T with update capabilities.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the Layer ids list.

wmsDefaultMapUnitsPerMm(project: QgsProject) float

Returns the default number of map units per millimeters in case of the scale is not given

Parameters:

project (QgsProject) – the QGIS project

Return type:

float

Returns:

the default number of map units per millimeter

New in version 3.4.

wmsExtent(project: QgsProject) QgsRectangle

Returns the WMS Extent restriction.

Parameters:

project (QgsProject) – the QGIS project

Return type:

QgsRectangle

Returns:

the WMS Extent restriction.

wmsFeatureInfoAddWktGeometry(project: QgsProject) bool

Returns if the geometry is displayed as Well Known Text in GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if the geometry is displayed as Well Known Text in GetFeatureInfo request.

wmsFeatureInfoDocumentElement(project: QgsProject) str

Returns the document element name for XML GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the document element name for XML GetFeatureInfo request.

wmsFeatureInfoDocumentElementNs(project: QgsProject) str

Returns the document element namespace for XML GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the document element namespace for XML GetFeatureInfo request.

wmsFeatureInfoLayerAliasMap(project: QgsProject) Dict[str, str]

Returns the mapping between layer name and wms layer name for GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

Dict[str, str]

Returns:

the mapping between layer name and wms layer name for GetFeatureInfo request.

wmsFeatureInfoPrecision(project: QgsProject) int

Returns the geometry precision for GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

the geometry precision for GetFeatureInfo request.

wmsFeatureInfoSchema(project: QgsProject) str

Returns the schema URL for XML GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the schema URL for XML GetFeatureInfo request.

wmsFeatureInfoSegmentizeWktGeometry(project: QgsProject) bool

Returns if the geometry has to be segmentize in GetFeatureInfo request.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if the geometry has to be segmentize in GetFeatureInfo request.

wmsFeatureInfoUseAttributeFormSettings(project: QgsProject) bool

Returns if feature form settings should be considered for the format of the feature info response

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

true if the feature form settings shall be considered for the feature info response

wmsImageQuality(project: QgsProject) int

Returns the quality for WMS images defined in a QGIS project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

quality if defined in project, -1 otherwise.

wmsInfoFormatSia2045(project: QgsProject) bool

Returns if the info format is SIA20145.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if the info format is SIA20145.

wmsInspireActivate(project: QgsProject) bool

Returns if Inspire is activated.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if Inspire is activated.

wmsInspireLanguage(project: QgsProject) str

Returns the Inspire language.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the Inspire language if defined in project.

wmsInspireMetadataDate(project: QgsProject) str

Returns the Inspire metadata date.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the Inspire metadata date if defined in project.

wmsInspireMetadataUrl(project: QgsProject) str

Returns the Inspire metadata URL.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the Inspire metadata URL if defined in project.

wmsInspireMetadataUrlType(project: QgsProject) str

Returns the Inspire metadata URL type.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the Inspire metadata URL type if defined in project.

wmsInspireTemporalReference(project: QgsProject) str

Returns the Inspire temporal reference.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

the Inspire temporal reference if defined in project.

wmsMaxAtlasFeatures(project: QgsProject) int

Returns the maximum number of atlas features which can be printed in a request

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

the number of atlas features

wmsMaxHeight(project: QgsProject) int

Returns the maximum height for WMS images defined in a QGIS project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

height if defined in project, -1 otherwise.

wmsMaxWidth(project: QgsProject) int

Returns the maximum width for WMS images defined in a QGIS project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

width if defined in project, -1 otherwise.

wmsOutputCrsList(project: QgsProject) List[str]

Returns the WMS output CRS list.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the WMS output CRS list.

wmsRenderMapTiles(project: QgsProject) bool

Returns True if WMS requests should use the QgsMapSettings.RenderMapTile flag, so that no visible artifacts are visible between adjacent tiles.

This flag can slow down rendering considerably, so it is only used if the corresponding setting is enabled in the project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

True if the flag should be used, or False if not.

New in version 3.18.

wmsRestrictedComposers(project: QgsProject) List[str]

Returns the restricted composer list.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the restricted composer list if defined in project.

wmsRestrictedLayers(project: QgsProject) List[str]

Returns the restricted layer name list.

Parameters:

project (QgsProject) – the QGIS project

Return type:

List[str]

Returns:

the restricted layer name list if defined in project.

wmsRootName(project: QgsProject) str

Returns the WMS root layer name defined in a QGIS project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

str

Returns:

root layer name to use for this service

wmsServiceUrl(project: QgsProject, request: QgsServerRequest = QgsServerRequest(), settings: QgsServerSettings = QgsServerSettings()) str

Returns the WMS service url. The URL defined in the project or if not defined the URL from serviceUrl.

Parameters:
Return type:

str

Returns:

url to use for this service

wmsTileBuffer(project: QgsProject) int

Returns the tile buffer in pixels for WMS images defined in a QGIS project.

Parameters:

project (QgsProject) – the QGIS project

Return type:

int

Returns:

tile buffer if defined in project, 0 otherwise.

New in version 3.10.

wmsUseLayerIds(project: QgsProject) bool

Returns if layer ids are used as name in WMS.

Parameters:

project (QgsProject) – the QGIS project

Return type:

bool

Returns:

if layer ids are used as name.

wmtsServiceUrl(project: QgsProject, request: QgsServerRequest = QgsServerRequest(), settings: QgsServerSettings = QgsServerSettings()) str

Returns the WMTS service url. The URL defined in the project or if not defined the URL from serviceUrl.

Parameters:
Return type:

str

Returns:

url to use for this service

New in version 3.4.