QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
QgsProcessingFeatureSourceDefinition Class Reference

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

#include <qgsprocessingparameters.h>

Public Types

enum  Flag { FlagOverrideDefaultGeometryCheck = 1 << 0 , FlagCreateIndividualOutputPerInputFeature = 1 << 1 }
 Flags which control source behavior. More...
 

Public Member Functions

 QgsProcessingFeatureSourceDefinition (const QgsProperty &source, bool selectedFeaturesOnly=false, long long featureLimit=-1, QgsProcessingFeatureSourceDefinition::Flags flags=QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck=QgsFeatureRequest::GeometryAbortOnInvalid, const QString &filterExpression=QString())
 Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
 
 QgsProcessingFeatureSourceDefinition (const QString &source=QString(), bool selectedFeaturesOnly=false, long long featureLimit=-1, QgsProcessingFeatureSourceDefinition::Flags flags=QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck=QgsFeatureRequest::GeometryAbortOnInvalid, const QString &filterExpression=QString())
 Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.
 
bool loadVariant (const QVariantMap &map)
 Loads this source definition from a QVariantMap, wrapped in a QVariant.
 
 operator QVariant () const
 Allows direct construction of QVariants.
 
bool operator!= (const QgsProcessingFeatureSourceDefinition &other) const
 
bool operator== (const QgsProcessingFeatureSourceDefinition &other) const
 
QVariant toVariant () const
 Saves this source definition to a QVariantMap, wrapped in a QVariant.
 

Public Attributes

long long featureLimit = -1
 If set to a value > 0, places a limit on the maximum number of features which will be read from the source.
 
QString filterExpression
 Optional expression filter to use for filtering features which will be read from the source.
 
Flags flags = Flags()
 Flags which dictate source behavior.
 
QgsFeatureRequest::InvalidGeometryCheck geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid
 Geometry check method to apply to this source.
 
bool selectedFeaturesOnly
 true if only selected features in the source should be used by algorithms.
 
QgsProperty source
 Source definition.
 

Detailed Description

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

Since
QGIS 3.0

Definition at line 56 of file qgsprocessingparameters.h.

Member Enumeration Documentation

◆ Flag

Flags which control source behavior.

Since
QGIS 3.14
Enumerator
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.

Definition at line 64 of file qgsprocessingparameters.h.

Constructor & Destructor Documentation

◆ QgsProcessingFeatureSourceDefinition() [1/2]

QgsProcessingFeatureSourceDefinition::QgsProcessingFeatureSourceDefinition ( const QString &  source = QString(),
bool  selectedFeaturesOnly = false,
long long  featureLimit = -1,
QgsProcessingFeatureSourceDefinition::Flags  flags = QgsProcessingFeatureSourceDefinition::Flags(),
QgsFeatureRequest::InvalidGeometryCheck  geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid,
const QString &  filterExpression = QString() 
)
inline

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.

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 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.

Definition at line 87 of file qgsprocessingparameters.h.

◆ QgsProcessingFeatureSourceDefinition() [2/2]

QgsProcessingFeatureSourceDefinition::QgsProcessingFeatureSourceDefinition ( const QgsProperty source,
bool  selectedFeaturesOnly = false,
long long  featureLimit = -1,
QgsProcessingFeatureSourceDefinition::Flags  flags = QgsProcessingFeatureSourceDefinition::Flags(),
QgsFeatureRequest::InvalidGeometryCheck  geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid,
const QString &  filterExpression = QString() 
)
inline

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.

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 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.

Definition at line 113 of file qgsprocessingparameters.h.

Member Function Documentation

◆ loadVariant()

bool QgsProcessingFeatureSourceDefinition::loadVariant ( const QVariantMap &  map)

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()
Since
QGIS 3.14

Definition at line 57 of file qgsprocessingparameters.cpp.

◆ operator QVariant()

QgsProcessingFeatureSourceDefinition::operator QVariant ( ) const
inline

Allows direct construction of QVariants.

Definition at line 198 of file qgsprocessingparameters.h.

◆ operator!=()

bool QgsProcessingFeatureSourceDefinition::operator!= ( const QgsProcessingFeatureSourceDefinition other) const
inline

Definition at line 192 of file qgsprocessingparameters.h.

◆ operator==()

bool QgsProcessingFeatureSourceDefinition::operator== ( const QgsProcessingFeatureSourceDefinition other) const
inline

Definition at line 182 of file qgsprocessingparameters.h.

◆ toVariant()

QVariant QgsProcessingFeatureSourceDefinition::toVariant ( ) const

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()
Since
QGIS 3.14

Definition at line 45 of file qgsprocessingparameters.cpp.

Member Data Documentation

◆ featureLimit

long long QgsProcessingFeatureSourceDefinition::featureLimit = -1

If set to a value > 0, places a limit on the maximum number of features which will be read from the source.

Since
QGIS 3.14

Definition at line 139 of file qgsprocessingparameters.h.

◆ filterExpression

QString QgsProcessingFeatureSourceDefinition::filterExpression

Optional expression filter to use for filtering features which will be read from the source.

Since
QGIS 3.32

Definition at line 146 of file qgsprocessingparameters.h.

◆ flags

Flags QgsProcessingFeatureSourceDefinition::flags = Flags()

Flags which dictate source behavior.

Since
QGIS 3.14

Definition at line 153 of file qgsprocessingparameters.h.

◆ geometryCheck

QgsFeatureRequest::InvalidGeometryCheck QgsProcessingFeatureSourceDefinition::geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid

Geometry check method to apply to this source.

This setting is only utilized if the QgsProcessingFeatureSourceDefinition::Flag::FlagCreateIndividualOutputPerInputFeature is set in QgsProcessingFeatureSourceDefinition::flags.

See also
overrideDefaultGeometryCheck
Since
QGIS 3.14

Definition at line 163 of file qgsprocessingparameters.h.

◆ selectedFeaturesOnly

bool QgsProcessingFeatureSourceDefinition::selectedFeaturesOnly

true if only selected features in the source should be used by algorithms.

Definition at line 131 of file qgsprocessingparameters.h.

◆ source

QgsProperty QgsProcessingFeatureSourceDefinition::source

Source definition.

Usually a static property set to a source layer's ID or file name.

Definition at line 126 of file qgsprocessingparameters.h.


The documentation for this class was generated from the following files: