Class: QgsMemoryProviderUtils

class qgis.core.QgsMemoryProviderUtils

Bases: sip.wrapper

Utility functions for use with the memory vector data provider.

New in version 3.0:

Methods

createMemoryLayer

Creates a new memory layer using the specified parameters.

createMemoryLayer(name: str, fields: QgsFields, geometryType: QgsWkbTypes.Type = QgsWkbTypes.NoGeometry, crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem(), loadDefaultStyle: bool = True) QgsVectorLayer

Creates a new memory layer using the specified parameters. The caller takes responsibility for deleting the newly created layer.

Parameters
  • name (str) – layer name

  • fields (QgsFields) – fields for layer

  • geometryType (QgsWkbTypes.Type = QgsWkbTypes.NoGeometry) – optional layer geometry type

  • crs (QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) – optional layer CRS for layers with geometry

  • loadDefaultStyle (bool = True) – optional load default style toggle

Return type

QgsVectorLayer