15 #ifndef QGSFEATUREREQUEST_H 16 #define QGSFEATUREREQUEST_H 18 #include "qgis_core.h" 79 SubsetOfAttributes = 2,
82 Q_DECLARE_FLAGS( Flags,
Flag )
99 GeometrySkipInvalid = 1,
100 GeometryAbortOnInvalid = 2,
138 OrderByClause(
const QString &expression,
bool ascending =
true );
147 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
187 bool ascending()
const;
192 void setAscending(
bool ascending );
198 bool nullsFirst()
const;
203 void setNullsFirst(
bool nullsFirst );
208 QString dump()
const;
226 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
238 CORE_EXPORT OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
246 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
251 void CORE_EXPORT save( QDomElement &elem )
const;
256 void CORE_EXPORT load(
const QDomElement &elem );
261 QSet<QString> CORE_EXPORT usedAttributes()
const;
266 QString CORE_EXPORT dump()
const;
365 Py_BEGIN_ALLOW_THREADS
367 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
370 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
449 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending =
true );
460 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
489 long limit()
const {
return mLimit; }
493 const Flags &
flags()
const {
return mFlags; }
593 Py_BEGIN_ALLOW_THREADS
595 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
598 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
628 bool acceptFeature(
const QgsFeature &feature );
684 bool requestMayBeNested()
const;
718 int mRequestMayBeNested =
false;
721 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureRequest::Flags )
753 #endif // QGSFEATUREREQUEST_H Class for parsing and evaluation of expressions (formerly called "search strings").
QgsCoordinateReferenceSystem mCrs
QgsFeatureIds mFilterFids
Wrapper for iterator of features from vector data provider or vector layer.
A rectangle specified with double values.
long limit() const
Returns the maximum number of features to request, or -1 if no limit set.
QgsSimplifyMethod mSimplifyMethod
QSet< QgsFeatureId > QgsFeatureIds
const Flags & flags() const
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
QgsFeatureId filterFid() const
Gets the feature ID that should be fetched.
FilterType filterType() const
Returns the filter type which is currently set on this request.
Container of fields for a vector layer.
const QgsFeatureIds & filterFids() const
Gets feature IDs that should be fetched.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
const QgsRectangle & filterRect() const
Returns the rectangle from which features will be taken.
QgsExpressionContext mExpressionContext
InvalidGeometryCheck
Handling of features with invalid geometries.
QgsExpression * filterExpression() const
Returns the filter expression if set.
QgsFeatureRequest & disableFilter()
Disables filter conditions.
std::unique_ptr< QgsExpression > mFilterExpression
Internal feature iterator to be implemented within data providers.
QSet< QgsAbstractFeatureIterator *> mActiveIterators
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
This class wraps a request for features to a vector layer (or directly its vector data provider)...
static const QString ALL_ATTRIBUTES
A special attribute that if set matches all attributes.
Contains information about the context in which a coordinate transform is executed.
Base class that can be used for any class that is capable of returning features.
QgsAttributeList subsetOfAttributes() const
Returns the subset of attributes which at least need to be fetched.
The OrderByClause class represents an order by clause for a QgsFeatureRequest.
std::function< void(const QgsFeature &) > mInvalidGeometryCallback
FilterType
Types of filters.
QgsCoordinateTransformContext mTransformContext
std::function< void(const QgsFeature &) > mTransformErrorCallback
This class represents a coordinate reference system (CRS).
InvalidGeometryCheck invalidGeometryCheck() const
Returns the invalid geometry checking behavior.
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
QList< int > QgsAttributeList
std::function< void(const QgsFeature &) > transformErrorCallback() const
Returns the callback function to use when encountering a transform error when iterating features and ...
const QgsSimplifyMethod & simplifyMethod() const
Gets simplification method for geometries that will be fetched.
std::function< void(const QgsFeature &) > invalidGeometryCallback() const
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck()...
Represents a list of OrderByClauses, with the most important first and the least important last...
Helper template that cares of two things: 1.