Class: QgsProcessingFeatureSource¶
- class qgis.core.QgsProcessingFeatureSource(originalSource: QgsFeatureSource, context: QgsProcessingContext, ownsOriginalSource: bool = False, featureLimit: int = - 1)¶
Bases:
QgsFeatureSource
Constructor for
QgsProcessingFeatureSource
, accepting an original feature sourceoriginalSource
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.QgsProcessingFeatureSource(
QgsProcessingFeatureSource
)QgsFeatureSource
subclass which proxies methods to an underlyingQgsFeatureSource
, modifying results according to the settings in aQgsProcessingContext
.Methods
- rtype
object
Returns an expression context scope suitable for this source.
- rtype
int
- rtype
QgsFields
Returns an iterator for the features in the source, respecting the supplied feature
flags
.- rtype
QgsFeatureSource.FeatureAvailability
- rtype
QgsFeatureSource.SpatialIndexPresence
- param fieldIndex
- param fieldIndex
Overrides the default geometry check method for the source.
- rtype
QgsCoordinateReferenceSystem
- rtype
QgsRectangle
- rtype
str
- param fieldIndex
- rtype
QgsWkbTypes.Type
Attributes
- class Flag¶
Bases:
int
- FlagSkipGeometryValidityChecks = 2¶
- class Flags¶
- class Flags(Union[QgsProcessingFeatureSource.Flags, QgsProcessingFeatureSource.Flag]) → None
- class Flags(QgsProcessingFeatureSource.Flags) → None
Bases:
sip.wrapper
- allFeatureIds(self) → object¶
- Return type
object
- createExpressionContextScope(self) → QgsExpressionContextScope¶
Returns an expression context scope suitable for this source.
- Return type
- featureCount(self) → int¶
- Return type
int
- 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 optionalrequest
can be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.getFeatures(self, request:
QgsFeatureRequest
= QgsFeatureRequest()) -> QgsFeatureIterator- Parameters
request (QgsFeatureRequest) –
flags (Union[QgsProcessingFeatureSource.Flags) –
- Return type
- hasFeatures(self) → QgsFeatureSource.FeatureAvailability¶
- Return type
- hasSpatialIndex(self) → QgsFeatureSource.SpatialIndexPresence¶
- Return type
- maximumValue(self, fieldIndex: int) → Any¶
- Parameters
fieldIndex (int) –
- Return type
Any
- minimumValue(self, fieldIndex: int) → Any¶
- Parameters
fieldIndex (int) –
- Return type
Any
- setInvalidGeometryCheck(self, method: QgsFeatureRequest.InvalidGeometryCheck)¶
Overrides the default geometry check method for the source.
New in version 3.14.
- Parameters
method (QgsFeatureRequest.InvalidGeometryCheck) –
- sourceCrs(self) → QgsCoordinateReferenceSystem¶
- Return type
- sourceExtent(self) → QgsRectangle¶
- Return type
- 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