Class: QgsVectorLayerFeatureSource

class qgis.core.QgsVectorLayerFeatureSource(layer: QgsVectorLayer)

Bases: QgsAbstractFeatureSource

Constructor for QgsVectorLayerFeatureSource.

Parameters

layer – source layer

Partial snapshot of vector layer’s state (only the members necessary for access to 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.

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.

New in version 3.0.

Return type

QgsCoordinateReferenceSystem

fields(self)QgsFields

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

New in version 3.0.

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)