Class: QgsServerApiUtils

class qgis.server.QgsServerApiUtils

Bases: sip.wrapper

The QgsServerApiUtils class contains helper functions to handle common API operations.

New in version 3.10: Enums

Methods

appendMapParameter

Appends MAP query string parameter from current requestUrl to the given path

crsToOgcUri

Returns a crs as OGC URI (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) Returns an empty string on failure.

parseBbox

Parses a comma separated bbox into a (possibily empty) QgsRectangle.

parseCrs

Parses the CRS URI bboxCrs (example: “http://www.opengis.net/def/crs/OGC/1.3/CRS84”) into a QGIS CRS object

publishedCrsList

Returns the list of CRSs (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) available for this project.

publishedFields

Returns the list of fields accessible to the service for a given layer.

publishedWfsLayers

Returns the list of layers accessible to the service for a given project.

sanitizedFieldValue

Sanitizes the input value by removing URL encoding and checking for malicious content.

Signals

Attributes

appendMapParameter(path: str, requestUrl: QUrl) → str

Appends MAP query string parameter from current requestUrl to the given path

crsToOgcUri(crs: QgsCoordinateReferenceSystem) → str

Returns a crs as OGC URI (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) Returns an empty string on failure.

parseBbox(bbox: str) → QgsRectangle

Parses a comma separated bbox into a (possibily empty) QgsRectangle.

Note

Z values (i.e. a 6 elements bbox) are silently discarded

parseCrs(bboxCrs: str) → QgsCoordinateReferenceSystem

Parses the CRS URI bboxCrs (example: “http://www.opengis.net/def/crs/OGC/1.3/CRS84”) into a QGIS CRS object

publishedCrsList(project: QgsProject) → List[str]

Returns the list of CRSs (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) available for this project. Information is read from project WMS configuration.

publishedFields(layer: QgsVectorLayer) → QgsFields

Returns the list of fields accessible to the service for a given layer.

This method takes into account the ACL restrictions provided by QGIS Server Access Control plugins. TODO: implement ACL

publishedWfsLayers(project: QgsProject) → object

Returns the list of layers accessible to the service for a given project.

This method takes into account the ACL restrictions provided by QGIS Server Access Control plugins.

Note

project must not be NULL TODO: implement ACL

sanitizedFieldValue(value: str) → str

Sanitizes the input value by removing URL encoding and checking for malicious content. In case of failure returns an empty string.