Class: QgsProcessingFeatureSource¶
QgsFeatureSource subclass which proxies methods to an
underlying QgsFeatureSource, modifying results according to
the settings in a QgsProcessingContext.
Class Hierarchy¶
Base classes¶
An interface for objects which provide features via a getFeatures method.  | 
Enums
alias of   | 
Methods
Returns an expression context scope suitable for this source.  | 
|
Returns an iterator for the features in the source, respecting the supplied feature flags.  | 
|
Returns the geometry check method for the source.  | 
|
Overrides the default geometry check method for the source.  | 
- class qgis.core.QgsProcessingFeatureSource[source]¶
 Bases:
QgsFeatureSource- __init__(originalSource: QgsFeatureSource | None, context: QgsProcessingContext, ownsOriginalSource: bool = False, featureLimit: int = -1, filterExpression: str | None = '')
 Constructor for QgsProcessingFeatureSource, accepting an original feature source
originalSourceand processingcontext. Ownership oforiginalSourceis dictated byownsOriginalSource. IfownsOriginalSourceisFalse, ownership is not transferred, and callers must ensure thatoriginalSourceexists for the lifetime of this object. IfownsOriginalSourceisTrue, then this object will take ownership oforiginalSource.If
featureLimitis set to a value > 0, then a limit is placed on the maximum number of features which will be read from the source.Since QGIS 3.32, the optional
filterExpressioncan be used to specify an expression based filter for the source.- Parameters:
 originalSource (Optional[QgsFeatureSource])
context (QgsProcessingContext)
ownsOriginalSource (bool = False)
featureLimit (int = -1)
filterExpression (Optional[str] = '')
- __init__(a0: QgsProcessingFeatureSource)
 - Parameters:
 
- Flag¶
 alias of
ProcessingFeatureSourceFlag
- Flags¶
 alias of
ProcessingFeatureSourceFlags
- createExpressionContextScope(self) QgsExpressionContextScope | None[source]¶
 Returns an expression context scope suitable for this source.
- Return type:
 Optional[QgsExpressionContextScope]
- getFeatures(self, request: QgsFeatureRequest, flags: Qgis.ProcessingFeatureSourceFlags | Qgis.ProcessingFeatureSourceFlag) QgsFeatureIterator[source]¶
 Returns an iterator for the features in the source, respecting the supplied feature
flags. An optionalrequestcan be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.- Parameters:
 request (
QgsFeatureRequest)flags (Union[Qgis.ProcessingFeatureSourceFlags, Qgis.ProcessingFeatureSourceFlag])
- Return type:
 
- getFeatures(self, request: QgsFeatureRequest = QgsFeatureRequest()) QgsFeatureIterator[source]
 - Parameters:
 request (
QgsFeatureRequest= QgsFeatureRequest())- Return type:
 
- invalidGeometryCheck(self) Qgis.InvalidGeometryCheck[source]¶
 Returns the geometry check method for the source.
See also
Added in version 3.36.
- Return type:
 
- setInvalidGeometryCheck(self, method: Qgis.InvalidGeometryCheck)[source]¶
 Overrides the default geometry check method for the source.
See also
Added in version 3.14.
- Parameters:
 method (Qgis.InvalidGeometryCheck)