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 |
Abstract Methods
Returns an iterator for the features in the source, respecting the supplied feature flags. |
Methods
Returns an expression context scope suitable for this source. |
|
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
originalSource
and processingcontext
. Ownership oforiginalSource
is dictated byownsOriginalSource
. IfownsOriginalSource
isFalse
, ownership is not transferred, and callers must ensure thatoriginalSource
exists for the lifetime of this object. IfownsOriginalSource
isTrue
, then this object will take ownership oforiginalSource
.If
featureLimit
is 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
filterExpression
can 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]
- abstract 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 optionalrequest
can 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:
- abstract 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)