Class: QgsStoreBadLayerInfo

class qgis.server.QgsStoreBadLayerInfo

Bases: QgsProjectBadLayerHandler

Default constructor

QgsStoreBadLayerInfo(QgsStoreBadLayerInfo)

Stores layer ids of bad layers

Methods

badLayerNames

Returns names of bad layers with ids.

badLayers

rtype

List[str]

dataSource

Returns the data source for the given layer

dataType

Returns data type associated with the given QgsProject file Dom node

handleBadLayers

type layers

Iterable[QDomNode]

providerType

Returns the physical storage type associated with the given layer

setDataSource

Set the datasource element to the new value

badLayerNames(self)Dict[str, str]

Returns names of bad layers with ids.

New in version 3.12.

Return type

Dict[str, str]

badLayers(self)List[str]
badLayers(None)None
Return type

List[str]

Returns

ids of bad layers

dataSource(self, layerNode: QDomNode)str

Returns the data source for the given layer

The QDomNode is a QgsProject Dom node corresponding to a map layer state.

Essentially dumps datasource tag.

New in version 3.0.

dataType(self, layerNode: QDomNode)QgsProjectBadLayerHandler.DataType

Returns data type associated with the given QgsProject file Dom node

The Dom node should represent the state associated with a specific layer.

New in version 3.0.

handleBadLayers(self, layers: Iterable[QDomNode])
handleBadLayers(None)None
Parameters

layers (Iterable[QDomNode]) – layer nodes

providerType(self, layerNode: QDomNode)QgsProjectBadLayerHandler.ProviderType

Returns the physical storage type associated with the given layer

The QDomNode is a QgsProject Dom node corresponding to a map layer state.

If the provider tag is “ogr”, then it’s a file type.

However, if the layer is a raster, then there won’t be a provider tag. It will always have an associated file.

If the layer doesn’t fall into either of the previous two categories, then it’s either a database or URL. If the datasource tag has “url=”, then it’s URL based and if it has “dbname=”>, then the layer data is in a database.

New in version 3.0.

setDataSource(self, layerNode: QDomNode, dataSource: str)

Set the datasource element to the new value

New in version 3.0.