15 #ifndef QGSFEATUREREQUEST_H 16 #define QGSFEATUREREQUEST_H 18 #include "qgis_core.h" 26 #include "qgsexpression.h" 74 SubsetOfAttributes = 2,
77 Q_DECLARE_FLAGS( Flags,
Flag )
94 GeometrySkipInvalid = 1,
95 GeometryAbortOnInvalid = 2,
133 OrderByClause(
const QString &expression,
bool ascending =
true );
142 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
152 OrderByClause(
const QgsExpression &expression,
bool ascending =
true );
161 OrderByClause(
const QgsExpression &expression,
bool ascending,
bool nullsfirst );
167 QgsExpression expression()
const;
182 bool ascending()
const;
187 void setAscending(
bool ascending );
193 bool nullsFirst()
const;
198 void setNullsFirst(
bool nullsFirst );
203 QString dump()
const;
208 QgsExpression mExpression;
221 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
233 CORE_EXPORT OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
241 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
246 void CORE_EXPORT save( QDomElement &elem )
const;
251 void CORE_EXPORT load(
const QDomElement &elem );
256 QSet<QString> CORE_EXPORT usedAttributes()
const;
261 QString CORE_EXPORT dump()
const;
360 Py_BEGIN_ALLOW_THREADS
362 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
365 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
444 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending =
true );
455 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
484 long limit()
const {
return mLimit; }
488 const Flags &
flags()
const {
return mFlags; }
577 Py_BEGIN_ALLOW_THREADS
579 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
582 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
612 bool acceptFeature(
const QgsFeature &feature );
622 int connectionTimeout()
const;
632 void setConnectionTimeout(
int connectionTimeout );
651 int mConnectionTimeout = -1;
654 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureRequest::Flags )
686 #endif // QGSFEATUREREQUEST_H 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
const Flags & flags() const
QSet< QgsFeatureId > QgsFeatureIds
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
QgsFeatureId filterFid() const
Get the feature ID that should be fetched.
FilterType filterType() const
Return the filter type which is currently set on this request.
Container of fields for a vector layer.
const QgsFeatureIds & filterFids() const
Get feature IDs that should be fetched.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
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
Return 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
Get 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.