Class: QgsFeaturePool

class qgis.analysis.QgsFeaturePool(layer: QgsVectorLayer)

Bases: qgis._core.QgsFeatureSink

Creates a new feature pool for layer.

A feature pool is based on a vector layer and caches features.

Note

This class is a technology preview and unstable API.

New in version 3.4: Enums

Methods

crs The coordinate reference system of this layer.
deleteFeature Removes a feature from this pool.
geometryType The geometry type of this layer.
getFeature Retrieves the feature with the specified id into feature.
layer Gets a pointer to the underlying layer.
layerId The layer id of the layer.
updateFeature Updates a feature in this pool.

Signals

Attributes

crs(self) → QgsCoordinateReferenceSystem

The coordinate reference system of this layer.

deleteFeature(self, fid: int)

Removes a feature from this pool. Implementations will remove the feature from the layer or from the data provider.

geometryType(self) → QgsWkbTypes.GeometryType

The geometry type of this layer.

getFeature(self, id: int, feature: QgsFeature, feedback: QgsFeedback = None) → bool

Retrieves the feature with the specified id into feature. It will be retrieved from the cache or from the underlying layer if unavailable. If the feature is neither available from the cache nor from the layer it will return False. If feedback is specified, the call may return if the feedback is canceled.

layer(self) → QgsVectorLayer

Gets a pointer to the underlying layer. May return a ``None`` if the layer has been deleted. This must only be called from the main thread.

layerId(self) → str

The layer id of the layer.

updateFeature(self, feature: QgsFeature)

Updates a feature in this pool. Implementations will update the feature on the layer or on the data provider.