QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
15 #ifndef QGSVECTORLAYERFEATUREITERATOR_H
16 #define QGSVECTORLAYERFEATUREITERATOR_H
18 #include "qgis_core.h"
140 bool close()
override;
155 QMap<int, int> attributesSourceToDestLayerMap
SIP_SKIP;
184 void addJoinedAttributesCached(
QgsFeature &f,
const QVariant &joinValue )
const;
185 void addJoinedAttributesDirect(
QgsFeature &f,
const QVariant &joinValue )
const;
188 bool isValid()
const override;
192 bool fetchFeature(
QgsFeature &feature )
override;
207 void prepareJoin(
int fieldIdx )
SIP_SKIP;
210 void prepareExpression(
int fieldIdx )
SIP_SKIP;
216 void prepareField(
int fieldIdx )
SIP_SKIP;
278 double mDistanceWithin = 0;
295 bool mHasVirtualAttributes;
302 void createExpressionContext();
303 std::unique_ptr<QgsExpressionContext> mExpressionContext;
307 QList< int > mPreparedFields;
308 QList< int > mFieldsToPrepare;
311 QList< FetchJoinInfo > mOrderedJoinInfoList;
317 bool prepareOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys )
override;
322 void createOrderedJoinList();
327 bool postProcessFeature(
QgsFeature &feature );
332 bool checkGeometryValidity(
const QgsFeature &feature );
334 bool mDelegatedOrderByToProvider =
false;
381 QPointer< QgsVectorLayer > mLayer;
392 QgsVectorLayerSelectedFeatureIterator(
const QgsFeatureIds &selectedFeatureIds,
397 bool close()
override;
412 #endif // QGSVECTORLAYERFEATUREITERATOR_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsExpressionContextScope mLayerScope
virtual SpatialIndexPresence hasSpatialIndex() const
Returns an enum value representing the presence of a valid spatial index on the source,...
virtual QgsCoordinateReferenceSystem sourceCrs() const =0
Returns the coordinate reference system for features in the source.
This class contains information about how to simplify geometries fetched from a QgsFeatureIterator.
virtual void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool nextFeatureFilterExpression(QgsFeature &f) override
Overrides default method as we only need to filter features in the edit buffer while for others filte...
QgsFeatureMap mAddedFeatures
const QgsCoordinateReferenceSystem & crs
Container of fields for a vector layer.
QgsAttributeList mDeletedAttributeIds
An interface for objects which provide features via a getFeatures method.
QgsChangedAttributesMap mChangedAttributeValues
Type
The WKB type describes the number of dimensions a geometry has.
Abstract interface for generating an expression context scope.
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QList< int > QgsAttributeList
A rectangle specified with double values.
Helper template that cares of two things: 1. automatic deletion of source if owned by iterator,...
QgsGeometryMap mChangedGeometries
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureSource subclass for the selected features from a QgsVectorLayer.
virtual QString sourceName() const =0
Returns a friendly display name for the source.
std::unique_ptr< QgsAbstractFeatureSource > mProviderFeatureSource
Base class for feedback objects to be used for cancellation of something running in a worker thread.
QList< QgsField > mAddedAttributes
SpatialIndexPresence
Enumeration of spatial index presence states.
Manages joined fields for a vector layer.
Base class that can be used for any class that is capable of returning features.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
Returns an iterator for the features in the source.
virtual long long featureCount() const =0
Returns the number of features contained in the source, or -1 if the feature count is unknown.
Defines left outer join from our vector layer to some other vector layer. The join is done based on [...
Buffers information about expression fields for a vector layer.
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
int indexOffset
At what position the joined fields start.
QSet< QgsFeatureId > QgsFeatureIds
virtual bool rewind()=0
reset the iterator to the starting position
This class represents a coordinate reference system (CRS).
QgsCoordinateReferenceSystem mCrs
virtual QgsFields fields() const =0
Returns the fields associated with features in the source.
Single scope for storing variables and functions for use within a QgsExpressionContext....
int targetField
Index of field (of this layer) that drives the join.
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAtt...
A geometry is the spatial representation of a feature.
virtual QgsWkbTypes::Type wkbType() const =0
Returns the geometry type for features returned by this source.
Represents a vector layer which manages a vector based data sets.
Partial snapshot of vector layer's state (only the members necessary for access to features)
virtual bool fetchFeature(QgsFeature &f)=0
If you write a feature iterator for your provider, this is the method you need to implement!...
std::shared_ptr< QgsVectorLayerFeatureSource > joinSource
Feature source for join.
std::unique_ptr< QgsExpressionFieldBuffer > mExpressionFieldBuffer
QgsAttributeList attributes
Attributes to fetch.
QgsFields joinLayerFields
Fields from joined layer.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
const QgsVectorLayerJoinInfo * joinInfo
Canonical source of information about the join.
Class for parsing and evaluation of expressions (formerly called "search strings")....
Wrapper for iterator of features from vector data provider or vector layer.
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
Internal feature iterator to be implemented within data providers.
QgsFeatureIds mDeletedFeatureIds
virtual bool close()=0
end of iterating: free the resources / lock
std::unique_ptr< QgsVectorLayerJoinBuffer > mJoinBuffer
virtual QgsExpressionContextScope * createExpressionContextScope() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features