Class: QgsProcessingFeatureSource

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

Bases: 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.

Parameters
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
Return type

object

createExpressionContextScope(self)QgsExpressionContextScope

Returns an expression context scope suitable for this source.

Return type

QgsExpressionContextScope

featureCount(self) → int
Return type

int

fields(self)QgsFields
Return type

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

Parameters
Return type

QgsFeatureIterator

hasFeatures(self) → QgsFeatureSource.FeatureAvailability
Return type

QgsFeatureSource.FeatureAvailability

hasSpatialIndex(self) → QgsFeatureSource.SpatialIndexPresence
Return type

QgsFeatureSource.SpatialIndexPresence

maximumValue(self, fieldIndex: int) → Any
Parameters

fieldIndex (int) –

Return type

Any

minimumValue(self, fieldIndex: int) → Any
Parameters

fieldIndex (int) –

Return type

Any

sourceCrs(self)QgsCoordinateReferenceSystem
Return type

QgsCoordinateReferenceSystem

sourceExtent(self)QgsRectangle
Return type

QgsRectangle

sourceName(self) → str
Return type

str

uniqueValues(self, fieldIndex: int, limit: int = - 1) → Set[Any]
Parameters
  • fieldIndex (int) –

  • limit (int = -1) –

Return type

Set[Any]

wkbType(self) → QgsWkbTypes.Type
Return type

QgsWkbTypes.Type