QGIS API Documentation
3.6.0-Noosa (5873452)
|
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext. More...
#include <qgsprocessingutils.h>
Public Types | |
enum | Flag { FlagSkipGeometryValidityChecks = 1 << 1 } |
Flags controlling how QgsProcessingFeatureSource fetches features. More... | |
Public Types inherited from QgsFeatureSource | |
enum | FeatureAvailability { NoFeaturesAvailable, FeaturesAvailable, FeaturesMaybeAvailable } |
Possible return value for hasFeatures() to determine if a source is empty. More... | |
Public Member Functions | |
QgsProcessingFeatureSource (QgsFeatureSource *originalSource, const QgsProcessingContext &context, bool ownsOriginalSource=false) | |
Constructor for QgsProcessingFeatureSource, accepting an original feature source originalSource and processing context. More... | |
~QgsProcessingFeatureSource () override | |
QgsFeatureIds | allFeatureIds () const override |
Returns a list of all feature IDs for features present in the source. More... | |
QgsExpressionContextScope * | createExpressionContextScope () const |
Returns an expression context scope suitable for this source. More... | |
long | featureCount () const override |
Returns the number of features contained in the source, or -1 if the feature count is unknown. More... | |
QgsFields | fields () const override |
Returns the fields associated with features in the source. More... | |
QgsFeatureIterator | getFeatures (const QgsFeatureRequest &request, Flags flags) const |
Returns an iterator for the features in the source, respecting the supplied feature flags. More... | |
QgsFeatureIterator | getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest()) const override |
Returns an iterator for the features in the source. More... | |
QgsFeatureSource::FeatureAvailability | hasFeatures () const override |
Determines if there are any features available in the source. More... | |
QVariant | maximumValue (int fieldIndex) const override |
Returns the maximum value for an attribute column or an invalid variant in case of error. More... | |
QVariant | minimumValue (int fieldIndex) const override |
Returns the minimum value for an attribute column or an invalid variant in case of error. More... | |
QgsCoordinateReferenceSystem | sourceCrs () const override |
Returns the coordinate reference system for features in the source. More... | |
QgsRectangle | sourceExtent () const override |
Returns the extent of all geometries from the source. More... | |
QString | sourceName () const override |
Returns a friendly display name for the source. More... | |
QSet< QVariant > | uniqueValues (int fieldIndex, int limit=-1) const override |
Returns the set of unique values contained within the specified fieldIndex from this source. More... | |
QgsWkbTypes::Type | wkbType () const override |
Returns the geometry type for features returned by this source. More... | |
Public Member Functions inherited from QgsFeatureSource | |
virtual | ~QgsFeatureSource ()=default |
QgsVectorLayer * | materialize (const QgsFeatureRequest &request, QgsFeedback *feedback=nullptr) |
Materializes a request (query) made against this feature source, by running it over the source and returning a new memory based vector layer containing the result. More... | |
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.
Definition at line 334 of file qgsprocessingutils.h.
Flags controlling how QgsProcessingFeatureSource fetches features.
Definition at line 339 of file qgsprocessingutils.h.
QgsProcessingFeatureSource::QgsProcessingFeatureSource | ( | QgsFeatureSource * | originalSource, |
const QgsProcessingContext & | context, | ||
bool | ownsOriginalSource = false |
||
) |
Constructor for QgsProcessingFeatureSource, accepting an original feature source originalSource and processing context.
Ownership of originalSource is dictated by ownsOriginalSource. If ownsOriginalSource is false, ownership is not transferred, and callers must ensure that originalSource exists for the lifetime of this object. If ownsOriginalSource is true, then this object will take ownership of originalSource.
Definition at line 896 of file qgsprocessingutils.cpp.
|
override |
Definition at line 906 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns a list of all feature IDs for features present in the source.
Reimplemented from QgsFeatureSource.
Definition at line 995 of file qgsprocessingutils.cpp.
QgsExpressionContextScope * QgsProcessingFeatureSource::createExpressionContextScope | ( | ) | const |
Returns an expression context scope suitable for this source.
Definition at line 1000 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the number of features contained in the source, or -1 if the feature count is unknown.
Implements QgsFeatureSource.
Definition at line 964 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the fields associated with features in the source.
Implements QgsFeatureSource.
Definition at line 954 of file qgsprocessingutils.cpp.
QgsFeatureIterator QgsProcessingFeatureSource::getFeatures | ( | const QgsFeatureRequest & | request, |
Flags | flags | ||
) | const |
Returns an iterator for the features in the source, respecting the supplied feature flags.
An optional request can be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.
Definition at line 912 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns an iterator for the features in the source.
An optional request can be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.
Implements QgsFeatureSource.
Definition at line 940 of file qgsprocessingutils.cpp.
|
overridevirtual |
Determines if there are any features available in the source.
Reimplemented from QgsFeatureSource.
Definition at line 928 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the maximum value for an attribute column or an invalid variant in case of error.
The base class implementation uses a non-optimised approach of looping through all features in the source.
Reimplemented from QgsFeatureSource.
Definition at line 985 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the minimum value for an attribute column or an invalid variant in case of error.
The base class implementation uses a non-optimised approach of looping through all features in the source.
Reimplemented from QgsFeatureSource.
Definition at line 980 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the coordinate reference system for features in the source.
Implements QgsFeatureSource.
Definition at line 949 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the extent of all geometries from the source.
The base class implementation uses a non-optimised approach of looping through all features in the source.
Reimplemented from QgsFeatureSource.
Definition at line 990 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns a friendly display name for the source.
The returned value can be an empty string.
Implements QgsFeatureSource.
Definition at line 969 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the set of unique values contained within the specified fieldIndex from this source.
If specified, the limit option can be used to limit the number of returned values. The base class implementation uses a non-optimised approach of looping through all features in the source.
Reimplemented from QgsFeatureSource.
Definition at line 975 of file qgsprocessingutils.cpp.
|
overridevirtual |
Returns the geometry type for features returned by this source.
Implements QgsFeatureSource.
Definition at line 959 of file qgsprocessingutils.cpp.