Class: QgsVectorLayerFeatureSource

class qgis.core.QgsVectorLayerFeatureSource

Bases: QgsAbstractFeatureSource

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

QgsVectorLayerFeatureSource(layer: QgsVectorLayer) Constructor for QgsVectorLayerFeatureSource.

Parameters:

layer

source layer

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.

getFeatures

param request:

id

Returns the layer id of the source layer.

iteratorClosed

iteratorOpened

crs(self) QgsCoordinateReferenceSystem

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

Return type:

QgsCoordinateReferenceSystem

fields(self) QgsFields

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

Return type:

QgsFields

getFeatures(self, request: QgsFeatureRequest = QgsFeatureRequest()) QgsFeatureIterator
Parameters:

request (QgsFeatureRequest = QgsFeatureRequest()) –

Return type:

QgsFeatureIterator

id(self) str

Returns the layer id of the source layer.

New in version 3.4.

Return type:

str

iteratorClosed(self, it: QgsAbstractFeatureIterator)
iteratorOpened(self, it: QgsAbstractFeatureIterator)