15#ifndef QGSFEATUREREQUEST_H
16#define QGSFEATUREREQUEST_H
121 OrderByClause(
const QString &expression,
bool ascending =
true );
130 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
169 bool ascending()
const;
174 void setAscending(
bool ascending );
180 bool nullsFirst()
const;
185 void setNullsFirst(
bool nullsFirst );
190 QString dump()
const;
196 return mExpression == v.mExpression &&
197 mAscending == v.mAscending &&
198 mNullsFirst == v.mNullsFirst;
203 return !( v == *this );
219 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
231 CORE_EXPORT
OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
251 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
256 void CORE_EXPORT save( QDomElement &elem )
const;
261 void CORE_EXPORT load(
const QDomElement &elem );
267 QSet<QString> CORE_EXPORT usedAttributes()
const;
273 QSet<int> CORE_EXPORT usedAttributeIndices(
const QgsFields &fields )
const;
278 QString CORE_EXPORT dump()
const;
492 Py_BEGIN_ALLOW_THREADS
494 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
497 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
579 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending =
true );
589 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
595 OrderBy orderBy()
const;
615 long long limit()
const {
return mLimit; }
617 long long limit()
const;
844 Py_BEGIN_ALLOW_THREADS
846 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
849 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
877 bool acceptFeature(
const QgsFeature &feature );
934 bool requestMayBeNested() const;
979 Qgis::FeatureRequestFilterType mFilter =
Qgis::FeatureRequestFilterType::NoFilter;
986 Qgis::SpatialFilterType mSpatialFilter =
Qgis::SpatialFilterType::NoFilter;
1006 double mDistanceWithin = 0;
1015 long long mLimit = -1;
1017 Qgis::InvalidGeometryCheck mInvalidGeometryFilter =
Qgis::InvalidGeometryCheck::NoCheck;
1018 std::function<
void( const
QgsFeature & ) > mInvalidGeometryCallback;
1019 std::function<
void( const
QgsFeature & ) > mTransformErrorCallback;
1024 int mRequestMayBeNested = false;
The Qgis class provides global constants for use throughout the application.
FeatureRequestFilterType
Types of feature request filters.
@ NoFilter
No filter is applied.
SpatialFilterType
Feature request spatial filter types.
QFlags< FeatureRequestFlag > FeatureRequestFlags
Flags for controlling feature requests.
InvalidGeometryCheck
Methods for handling of features with invalid geometries.
Helper template that cares of two things: 1.
Internal feature iterator to be implemented within data providers.
Base class that can be used for any class that is capable of returning features.
QSet< QgsAbstractFeatureIterator * > mActiveIterators
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Class for parsing and evaluation of expressions (formerly called "search strings").
Wrapper for iterator of features from vector data provider or vector layer.
The OrderByClause class represents an order by clause for a QgsFeatureRequest.
bool operator==(const OrderByClause &v) const
bool operator!=(const OrderByClause &v) const
Represents a list of OrderByClauses, with the most important first and the least important last.
CORE_EXPORT OrderBy()
Create a new empty order by.
This class wraps a request for features to a vector layer (or directly its vector data provider).
long long limit() const
Returns the maximum number of features to request, or -1 if no limit set.
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
std::function< void(const QgsFeature &) > transformErrorCallback() const
Returns the callback function to use when encountering a transform error when iterating features and ...
std::function< void(const QgsFeature &) > invalidGeometryCallback() const
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck()...
Qgis::FeatureRequestFilterType filterType() const
Returns the attribute/ID filter type which is currently set on this request.
QgsGeometry referenceGeometry() const
Returns the reference geometry used for spatial filtering of features.
static const QString ALL_ATTRIBUTES
A special attribute that if set matches all attributes.
Qgis::FeatureRequestFlags flags() const
Returns the flags which affect how features are fetched.
QgsFeatureRequest & disableFilter()
Disables any attribute/ID filtering.
QgsExpression * filterExpression() const
Returns the filter expression (if set).
const QgsSimplifyMethod & simplifyMethod() const
Returns the simplification method for geometries that will be fetched.
std::shared_ptr< QgsGeometryEngine > referenceGeometryEngine() const
Returns the reference geometry engine used for spatial filtering of features.
Qgis::SpatialFilterType spatialFilterType() const
Returns the spatial filter type which is currently set on this request.
double distanceWithin() const
Returns the maximum distance from the referenceGeometry() of fetched features, if spatialFilterType()...
QgsAttributeList subsetOfAttributes() const
Returns the subset of attributes which at least need to be fetched.
Qgis::InvalidGeometryCheck invalidGeometryCheck() const
Returns the invalid geometry checking behavior.
const QgsFeatureIds & filterFids() const
Returns the feature IDs that should be fetched.
QgsFeatureId filterFid() const
Returns the feature ID that should be fetched.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QList< int > QgsAttributeList
const QgsCoordinateReferenceSystem & crs