Class: QgsVectorLayerFeatureSource

Partial snapshot of vector layer’s state (only the members necessary for access to features).

Class Hierarchy

Inheritance diagram of qgis.core.QgsVectorLayerFeatureSource

Base classes

QgsAbstractFeatureSource

Base class that can be used for any class that is capable of returning features.

Methods

crs

Returns the coordinate reference system for features retrieved from this source.

fields

Returns the fields that will be available for features that are retrieved from this source.

id

Returns the layer id of the source layer.

class qgis.core.QgsVectorLayerFeatureSource[source]

Bases: QgsAbstractFeatureSource

__init__(layer: QgsVectorLayer | None)

Constructor for QgsVectorLayerFeatureSource.

Parameters:

layer (Optional[QgsVectorLayer]) – source layer

crs(self) QgsCoordinateReferenceSystem[source]

Returns the coordinate reference system for features retrieved from this source.

Return type:

QgsCoordinateReferenceSystem

fields(self) QgsFields[source]

Returns the fields that will be available for features that are retrieved from this source.

Return type:

QgsFields

id(self) str[source]

Returns the layer id of the source layer.

Added in version 3.4.

Return type:

str