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 );
239 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
244 void CORE_EXPORT save( QDomElement &elem )
const;
249 void CORE_EXPORT load(
const QDomElement &elem );
255 QSet<QString> CORE_EXPORT usedAttributes()
const;
261 QSet<int> CORE_EXPORT usedAttributeIndices(
const QgsFields &fields )
const;
266 QString CORE_EXPORT dump()
const;
474 Py_BEGIN_ALLOW_THREADS
476 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
479 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
561 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending =
true );
571 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
577 OrderBy orderBy()
const;
597 long long limit()
const {
return mLimit; }
599 long long limit()
const;
614 Qgis::FeatureRequestFlags
flags()
const {
return mFlags; }
759 Py_BEGIN_ALLOW_THREADS
761 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
764 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
792 bool acceptFeature(
const QgsFeature &feature );
849 bool requestMayBeNested() const;
894 Qgis::FeatureRequestFilterType mFilter =
Qgis::FeatureRequestFilterType::NoFilter;
901 Qgis::SpatialFilterType mSpatialFilter =
Qgis::SpatialFilterType::NoFilter;
921 double mDistanceWithin = 0;
927 Qgis::FeatureRequestFlags mFlags;
930 long long mLimit = -1;
932 Qgis::InvalidGeometryCheck mInvalidGeometryFilter =
Qgis::InvalidGeometryCheck::NoCheck;
933 std::function<
void( const
QgsFeature & ) > mInvalidGeometryCallback;
934 std::function<
void( const
QgsFeature & ) > mTransformErrorCallback;
938 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.
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
QList< int > QgsAttributeList
const QgsCoordinateReferenceSystem & crs