Class: QgsProcessingFeatureSourceDefinition¶
- class qgis.core.QgsProcessingFeatureSourceDefinition¶
Bases:
sip.wrapper
Encapsulates settings relating to a feature source input to a processing algorithm.
QgsProcessingFeatureSourceDefinition(source: str = ‘’, selectedFeaturesOnly: bool = False, featureLimit: int = -1, flags: Union[Qgis.ProcessingFeatureSourceDefinitionFlags, Qgis.ProcessingFeatureSourceDefinitionFlag] = Qgis.ProcessingFeatureSourceDefinitionFlags(), geometryCheck: Qgis.InvalidGeometryCheck = Qgis.InvalidGeometryCheck.AbortOnInvalid, filterExpression: str = ‘’) Constructor for
QgsProcessingFeatureSourceDefinition
, accepting a static stringsource
.If
selectedFeaturesOnly
isTrue
, then only selected features from the source will be used.The optional
featureLimit
can be set to a value > 0 to place a hard limit on the maximum number of features which will be read from the source.Since QGIS 3.32, the optional
filterExpression
argument can be used to specify a expression to use to filter the features read from the source.The
flags
argument can be used to specify flags which dictate the source behavior.If the
Qgis
.ProcessingFeatureSourceDefinitionFlag.OverrideDefaultGeometryCheck is set inflags
, then the value ofgeometryCheck
will override the default geometry check method (as dictated byQgsProcessingContext
) for this source.QgsProcessingFeatureSourceDefinition(source:
QgsProperty
, selectedFeaturesOnly: bool = False, featureLimit: int = -1, flags: Union[Qgis.ProcessingFeatureSourceDefinitionFlags, Qgis.ProcessingFeatureSourceDefinitionFlag] = Qgis.ProcessingFeatureSourceDefinitionFlags(), geometryCheck: Qgis.InvalidGeometryCheck = Qgis.InvalidGeometryCheck.AbortOnInvalid, filterExpression: str = ‘’) Constructor forQgsProcessingFeatureSourceDefinition
, accepting aQgsProperty
source.If
selectedFeaturesOnly
isTrue
, then only selected features from the source will be used.The optional
featureLimit
can be set to a value > 0 to place a hard limit on the maximum number of features which will be read from the source.Since QGIS 3.32, the optional
filterExpression
argument can be used to specify a expression to use to filter the features read from the source.The
flags
argument can be used to specify flags which dictate the source behavior.If the
Qgis
.ProcessingFeatureSourceDefinitionFlag.OverrideDefaultGeometryCheck is set inflags
, then the value ofgeometryCheck
will override the default geometry check method (as dictated byQgsProcessingContext
) for this source.QgsProcessingFeatureSourceDefinition(
QgsProcessingFeatureSourceDefinition
)Enums
Methods
Loads this source definition from a QVariantMap, wrapped in a QVariant.
Saves this source definition to a QVariantMap, wrapped in a QVariant.
Attributes
- Flag¶
- Flags¶
- featureLimit¶
- filterExpression¶
- flags¶
- geometryCheck¶
- loadVariant(self, map: Dict[str, Any]) bool ¶
Loads this source definition from a QVariantMap, wrapped in a QVariant. You can use
QgsXmlUtils
.readVariant to load it from an XML document.See also
New in version 3.14.
- Parameters:
map (Dict[str) –
- Return type:
bool
- selectedFeaturesOnly¶
- source¶
- toVariant(self) Any ¶
Saves this source definition to a QVariantMap, wrapped in a QVariant. You can use
QgsXmlUtils
.writeVariant to save it to an XML document.See also
New in version 3.14.
- Return type:
Any