Class: QgsMapLayerFactory

class qgis.core.QgsMapLayerFactory

Bases: sip.wrapper

Contains utility functions for creating map layers.

Methods

typeFromString

Returns the map layer type corresponding a string value.

typeToString

Converts a map layer type to a string value.

typeFromString(string: str)Tuple[QgsMapLayerType, bool]

Returns the map layer type corresponding a string value.

Parameters

string (str) – string to convert to map layer type

Return type

Tuple[QgsMapLayerType, bool]

Returns

  • converted map layer type

  • ok: will be set to True if string was successfully converted to a map layer type

See also

typeToString()

typeToString(type: QgsMapLayerType)str

Converts a map layer type to a string value.

See also

typeFromString()

Parameters

type (QgsMapLayerType) –

Return type

str