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 )
735 virtual ~QgsAbstractFeatureSource();
745 void iteratorOpened( QgsAbstractFeatureIterator *it );
746 void iteratorClosed( QgsAbstractFeatureIterator *it );
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.
const QgsSimplifyMethod & simplifyMethod() const
Gets simplification method for geometries that will be fetched.
A rectangle specified with double values.
const Flags & flags() const
QgsSimplifyMethod mSimplifyMethod
QSet< QgsFeatureId > QgsFeatureIds
QgsFeatureId filterFid() const
Gets the feature ID that should be fetched.
const QgsRectangle & filterRect() const
Returns the rectangle from which features will be taken.
std::function< void(const QgsFeature &) > invalidGeometryCallback() const
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck()...
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
const QgsFeatureIds & filterFids() const
Gets feature IDs that should be fetched.
QgsAttributeList subsetOfAttributes() const
Returns the subset of attributes which at least need to be fetched.
std::function< void(const QgsFeature &) > transformErrorCallback() const
Returns the callback function to use when encountering a transform error when iterating features and ...
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
QgsExpressionContext mExpressionContext
InvalidGeometryCheck
Handling of features with invalid geometries.
InvalidGeometryCheck invalidGeometryCheck() const
Returns the invalid geometry checking behavior.
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.
FilterType filterType() const
Returns the filter type which is currently set on this request.
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.
long limit() const
Returns the maximum number of features to request, or -1 if no limit set.
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).
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
QList< int > QgsAttributeList
Represents a list of OrderByClauses, with the most important first and the least important last...
Helper template that cares of two things: 1.
QgsExpression * filterExpression() const
Returns the filter expression if set.