Subgroup: Processing

Class: QgsProcessingFeatureSource

class qgis.core.QgsProcessingFeatureSource(originalSource: QgsFeatureSource, context: QgsProcessingContext, ownsOriginalSource: bool = False)

Bases: qgis._core.QgsFeatureSource

Constructor for QgsProcessingFeatureSource, accepting an original feature source originalSource and processing context. Ownership of originalSource is dictated by ownsOriginalSource. If ownsOriginalSource is false, ownership is not transferred, and callers must ensure that originalSource exists for the lifetime of this object. If ownsOriginalSource is true, then this object will take ownership of originalSource.

QgsProcessingFeatureSource(QgsProcessingFeatureSource)

QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.

New in version 3.0: Methods

allFeatureIds
createExpressionContextScope Returns an expression context scope suitable for this source.
featureCount
fields
getFeatures Returns an iterator for the features in the source, respecting the supplied feature flags.
hasFeatures
maximumValue
minimumValue
sourceCrs
sourceExtent
sourceName
uniqueValues
wkbType

Signals

Attributes

FlagSkipGeometryValidityChecks
class Flag

Bases: int

FlagSkipGeometryValidityChecks = 2
class Flags

Bases: sip.wrapper

QgsProcessingFeatureSource.Flags(Union[QgsProcessingFeatureSource.Flags, QgsProcessingFeatureSource.Flag]) QgsProcessingFeatureSource.Flags(QgsProcessingFeatureSource.Flags)

allFeatureIds(self) → object
createExpressionContextScope(self) → QgsExpressionContextScope

Returns an expression context scope suitable for this source.

featureCount(self) → int
fields(self) → QgsFields
getFeatures(self, request: QgsFeatureRequest, flags: Union[QgsProcessingFeatureSource.Flags, QgsProcessingFeatureSource.Flag]) → QgsFeatureIterator

Returns an iterator for the features in the source, respecting the supplied feature flags. An optional request can be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.

getFeatures(self, request: QgsFeatureRequest = QgsFeatureRequest()) -> QgsFeatureIterator

hasFeatures(self) → QgsFeatureSource.FeatureAvailability
maximumValue(self, fieldIndex: int) → Any
minimumValue(self, fieldIndex: int) → Any
sourceCrs(self) → QgsCoordinateReferenceSystem
sourceExtent(self) → QgsRectangle
sourceName(self) → str
uniqueValues(self, fieldIndex: int, limit: int = -1) → Set[Any]
wkbType(self) → QgsWkbTypes.Type