15#ifndef QGSVECTORLAYERFEATUREITERATOR_H
16#define QGSVECTORLAYERFEATUREITERATOR_H
166 bool close()
override;
233 void prepareJoin(
int fieldIdx )
SIP_SKIP;
236 void prepareExpression(
int fieldIdx )
SIP_SKIP;
242 void prepareField(
int fieldIdx )
SIP_SKIP;
328 void createExpressionContext();
329 std::unique_ptr<QgsExpressionContext> mExpressionContext;
333 QList< int > mPreparedFields;
334 QList< int > mFieldsToPrepare;
337 QList< FetchJoinInfo > mOrderedJoinInfoList;
343 bool prepareOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys )
override;
348 void createOrderedJoinList();
353 bool postProcessFeature(
QgsFeature &feature );
358 bool checkGeometryValidity(
const QgsFeature &feature );
360 bool mDelegatedOrderByToProvider =
false;
404 QPointer< QgsVectorLayer > mLayer;
415 QgsVectorLayerSelectedFeatureIterator(
const QgsFeatureIds &selectedFeatureIds,
420 bool close()
override;
SpatialIndexPresence
Enumeration of spatial index presence states.
WkbType
The WKB type describes the number of dimensions a geometry has.
QgsAbstractFeatureIteratorFromSource(QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request)
Internal feature iterator to be implemented within data providers.
virtual bool rewind()=0
Resets the iterator to the starting position.
friend class QgsFeatureIterator
virtual bool fetchFeature(QgsFeature &f)=0
If you write a feature iterator for your provider, this is the method you need to implement!
virtual bool close()=0
Call to end the iteration.
Base class that can be used for any class that is capable of returning features.
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
Represents a coordinate reference system (CRS).
Abstract interface for generating an expression context scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Buffers information about expression fields for a vector layer.
Handles parsing and evaluation of expressions (formerly called "search strings").
Wrapper for iterator of features from vector data provider or vector layer.
Wraps a request for features to a vector layer (or directly its vector data provider).
An interface for objects which provide features via a getFeatures method.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
A geometry engine is a low-level representation of a QgsAbstractGeometry object, optimised for use wi...
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
Contains information about how to simplify geometries fetched from a QgsFeatureIterator.
Stores queued vector layer edit operations prior to committing changes to the layer's data provider.
A feature iterator which iterates over features from a QgsVectorLayer.
QMap< const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo > mFetchJoinInfo
Information about joins used in the current select() statement.
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
bool mHasVirtualAttributes
QgsFeatureRequest mProviderRequest
QSet< QgsFeatureId > mFetchConsidered
void setInterruptionChecker(QgsFeedback *interruptionChecker) override
Attach an object that can be queried regularly by the iterator to check if it must stopped.
bool close() override
end of iterating: free the resources / lock
bool nextFeatureFilterExpression(QgsFeature &f) override
Overrides default method as we only need to filter features in the edit buffer while for others filte...
QgsFeatureRequest mChangedFeaturesRequest
QgsGeometry mDistanceWithinGeom
QgsFeatureIterator mChangedFeaturesIterator
QMap< int, QgsExpression * > mExpressionFieldInfo
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
bool fetchFeature(QgsFeature &feature) override
fetch next feature, return true on success
std::shared_ptr< QgsGeometryEngine > mDistanceWithinEngine
bool isValid() const override
Returns if this iterator is valid.
bool rewind() override
reset the iterator to the starting position
QgsFeatureIterator mProviderIterator
QgsCoordinateTransform mTransform
QgsVectorLayerFeatureIterator(QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request)
Partial snapshot of vector layer's state (only the members necessary for access to features).
QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system for features retrieved from this source.
QgsChangedAttributesMap mChangedAttributeValues
QgsCoordinateReferenceSystem mCrs
QList< QgsField > mAddedAttributes
std::unique_ptr< QgsAbstractFeatureSource > mProviderFeatureSource
QgsVectorLayerFeatureSource(const QgsVectorLayer *layer)
Constructor for QgsVectorLayerFeatureSource.
~QgsVectorLayerFeatureSource() override
QgsFeatureIds mDeletedFeatureIds
QString id() const
Returns the layer id of the source layer.
QgsAttributeList mDeletedAttributeIds
QgsExpressionContextScope mLayerScope
QgsFields fields() const
Returns the fields that will be available for features that are retrieved from this source.
QgsVectorLayerFeatureSource(const QgsVectorLayerFeatureSource &other)=delete
std::unique_ptr< QgsVectorLayerJoinBuffer > mJoinBuffer
std::unique_ptr< QgsExpressionFieldBuffer > mExpressionFieldBuffer
QMap< QString, JoinLayerSource > mJoinSources
Contains prepared join sources by layer ID.
friend class QgsVectorLayerFeatureIterator
QgsFeatureMap mAddedFeatures
QgsVectorLayerFeatureSource & operator==(const QgsVectorLayerFeatureSource &other)=delete
QgsGeometryMap mChangedGeometries
Manages joined fields for a vector layer.
Defines left outer join from our vector layer to some other vector layer.
QgsVectorLayerSelectedFeatureSource(const QgsVectorLayerSelectedFeatureSource &other)=delete
long long featureCount() const override
Returns the number of features contained in the source, or -1 if the feature count is unknown.
Qgis::WkbType wkbType() const override
Returns the geometry type for features returned by this source.
Qgis::SpatialIndexPresence hasSpatialIndex() const override
Returns an enum value representing the presence of a valid spatial index on the source,...
QgsFields fields() const override
Returns the fields associated with features in the source.
QgsCoordinateReferenceSystem sourceCrs() const override
Returns the coordinate reference system for features in the source.
QgsVectorLayerSelectedFeatureSource(QgsVectorLayer *layer)
Constructor for QgsVectorLayerSelectedFeatureSource, for selected features from the specified layer.
QgsVectorLayerSelectedFeatureSource & operator==(const QgsVectorLayerSelectedFeatureSource &other)=delete
QgsExpressionContextScope * createExpressionContextScope() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QString sourceName() const override
Returns a friendly display name for the source.
Represents a vector layer which manages a vector based dataset.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
QList< int > QgsAttributeList
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAtt...
QMap< int, int > attributesSourceToDestLayerMap
Mapping from original attribute index to the joined layer index.
void addJoinedAttributesDirect(QgsFeature &f, const QVariant &joinValue) const
std::shared_ptr< QgsVectorLayerFeatureSource > joinSource
Feature source for join.
QgsFields joinLayerFields
Fields from joined layer.
int targetField
Index of field (of this layer) that drives the join.
const QgsVectorLayerJoinInfo * joinInfo
Canonical source of information about the join.
QgsAttributeList attributes
Attributes to fetch.
int indexOffset
At what position the joined fields start.
void addJoinedAttributesCached(QgsFeature &f, const QVariant &joinValue) const
Contains join layer source information prepared in a thread-safe way, ready for vector layer feature ...
std::shared_ptr< QgsVectorLayerFeatureSource > joinSource
Feature source for join.
QgsFields joinLayerFields
Fields from joined layer.