QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
15 #ifndef QGSFEATUREREQUEST_H
16 #define QGSFEATUREREQUEST_H
18 #include "qgis_core.h"
82 SubsetOfAttributes = 2,
85 Q_DECLARE_FLAGS( Flags, Flag )
102 GeometrySkipInvalid = 1,
103 GeometryAbortOnInvalid = 2,
141 OrderByClause(
const QString &expression,
bool ascending =
true );
150 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
190 bool ascending()
const;
195 void setAscending(
bool ascending );
201 bool nullsFirst()
const;
206 void setNullsFirst(
bool nullsFirst );
211 QString dump()
const;
229 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
241 CORE_EXPORT
OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
249 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
254 void CORE_EXPORT save( QDomElement &elem )
const;
259 void CORE_EXPORT load(
const QDomElement &elem );
265 QSet<QString> CORE_EXPORT usedAttributes()
const;
271 QSet<int> CORE_EXPORT usedAttributeIndices(
const QgsFields &fields )
const;
276 QString CORE_EXPORT dump()
const;
375 Py_BEGIN_ALLOW_THREADS
377 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
380 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
459 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending =
true );
470 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
477 OrderBy orderBy()
const;
499 long limit()
const {
return mLimit; }
503 const Flags &
flags()
const {
return mFlags; }
603 Py_BEGIN_ALLOW_THREADS
605 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
608 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
638 bool acceptFeature(
const QgsFeature &feature );
694 bool requestMayBeNested() const;
717 Flags mFlags = Flags();
723 std::function<
void( const
QgsFeature & ) > mInvalidGeometryCallback;
724 std::function<
void( const
QgsFeature & ) > mTransformErrorCallback;
728 int mRequestMayBeNested = false;
763 #endif // QGSFEATUREREQUEST_H
std::function< void(const QgsFeature &) > invalidGeometryCallback() const
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck()...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The OrderByClause class represents an order by clause for a QgsFeatureRequest.
@ FilterFid
Filter using feature ID.
Contains information about the context in which a coordinate transform is executed.
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
const QgsFeatureIds & filterFids() const
Gets feature IDs that should be fetched.
CORE_EXPORT OrderBy()
Create a new empty order by.
QgsFeatureId filterFid() const
Gets the feature ID that should be fetched.
const Flags & flags() const
const QgsRectangle & filterRect() const
Returns the rectangle from which features will be taken.
const QgsCoordinateReferenceSystem & crs
FilterType filterType() const
Returns the filter type which is currently set on this request.
Container of fields for a vector layer.
QSet< QgsAbstractFeatureIterator * > mActiveIterators
InvalidGeometryCheck
Handling of features with invalid geometries.
QList< int > QgsAttributeList
A rectangle specified with double values.
QgsFeatureRequest & disableFilter()
Disables filter conditions.
Helper template that cares of two things: 1.
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
static const QString ALL_ATTRIBUTES
A special attribute that if set matches all attributes.
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsExpression * filterExpression() const
Returns the filter expression if set.
Base class that can be used for any class that is capable of returning features.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
@ FilterExpression
Filter using expression.
QSet< QgsFeatureId > QgsFeatureIds
This class represents a coordinate reference system (CRS).
FilterType
Types of filters.
Represents a list of OrderByClauses, with the most important first and the least important last.
InvalidGeometryCheck invalidGeometryCheck() const
Returns the invalid geometry checking behavior.
QgsAttributeList subsetOfAttributes() const
Returns the subset of attributes which at least need to be fetched.
const QgsSimplifyMethod & simplifyMethod() const
Gets simplification method for geometries that will be fetched.
@ FilterNone
No filter is applied.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
std::function< void(const QgsFeature &) > transformErrorCallback() const
Returns the callback function to use when encountering a transform error when iterating features and ...
Class for parsing and evaluation of expressions (formerly called "search strings").
Wrapper for iterator of features from vector data provider or vector layer.
Internal feature iterator to be implemented within data providers.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
long limit() const
Returns the maximum number of features to request, or -1 if no limit set.