Class: QgsWmsUtils

Contains utility functions for OGC WMS layers.

Added in version 4.0.

Static Methods

isWmsLayer

Returns whether a map layer is an OGC WMS layer or not.

wmsVersion

Returns the WMS version of a WMS layer as a string (e.g., "1.3.0").

class qgis.core.QgsWmsUtils[source]

Bases: object

static isWmsLayer(layer: QgsMapLayer | None) bool[source]

Returns whether a map layer is an OGC WMS layer or not.

Parameters:

layer (Optional[QgsMapLayer]) – Map layer that will be checked.

Note

This method is strictly checking for OGC WMS sources. It will return False for WMTS or XYZ tile layers.

Return type:

bool

static wmsVersion(layer: QgsRasterLayer | None) str[source]

Returns the WMS version of a WMS layer as a string (e.g., “1.3.0”).

Returns an empty string if the layer is not a valid WMS layer.

Parameters:

layer (Optional[QgsRasterLayer]) – WMS layer from which the version will be queried.

Return type:

str