Class: QgsProcessingFeatureSourceDefinition

class qgis.core.QgsProcessingFeatureSourceDefinition(source: str = '', selectedFeaturesOnly: bool = False, featureLimit: int = - 1, flags: Union[QgsProcessingFeatureSourceDefinition.Flags, QgsProcessingFeatureSourceDefinition.Flag] = 0, geometryCheck: QgsFeatureRequest.InvalidGeometryCheck = QgsFeatureRequest.GeometryAbortOnInvalid)

Bases: sip.wrapper

Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.

If selectedFeaturesOnly is True, 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.

The flags argument can be used to specify flags which dictate the source behavior.

If the QgsProcessingFeatureSourceDefinition.Flag.FlagOverrideDefaultGeometryCheck is set in flags, then the value of geometryCheck will override the default geometry check method (as dictated by QgsProcessingContext) for this source.

QgsProcessingFeatureSourceDefinition(source: QgsProperty, selectedFeaturesOnly: bool = False, featureLimit: int = -1, flags: Union[QgsProcessingFeatureSourceDefinition.Flags, QgsProcessingFeatureSourceDefinition.Flag] = 0, geometryCheck: QgsFeatureRequest.InvalidGeometryCheck = QgsFeatureRequest.GeometryAbortOnInvalid) Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.

If selectedFeaturesOnly is True, 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.

The flags argument can be used to specify flags which dictate the source behavior.

If the QgsProcessingFeatureSourceDefinition.Flag.FlagOverrideDefaultGeometryCheck is set in flags, then the value of geometryCheck will override the default geometry check method (as dictated by QgsProcessingContext) for this source.

QgsProcessingFeatureSourceDefinition(QgsProcessingFeatureSourceDefinition)

Encapsulates settings relating to a feature source input to a processing algorithm.

New in version 3.0.

Parameters
class Flag

Bases: enum.IntEnum

Flags which control source behavior.

New in version 3.14.

  • FlagOverrideDefaultGeometryCheck: If set, the default geometry check method (as dictated by QgsProcessingContext) will be overridden for this source

  • FlagCreateIndividualOutputPerInputFeature: If set, every feature processed from this source will be placed into its own individually created output destination. Support for this flag depends on how an algorithm is executed.

FlagCreateIndividualOutputPerInputFeature = 2
FlagOverrideDefaultGeometryCheck = 1
class Flags

Bases: sip.wrapper

QgsProcessingFeatureSourceDefinition.Flags(Union[QgsProcessingFeatureSourceDefinition.Flags, QgsProcessingFeatureSourceDefinition.Flag]) QgsProcessingFeatureSourceDefinition.Flags(QgsProcessingFeatureSourceDefinition.Flags)

featureLimit
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

toVariant()

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

loadVariant()

New in version 3.14.

Return type

Any