QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
23 , mVectorLayerCache( vlCache )
39 if ( !mFilterRect.
isNull() )
56 mFeatureIds = qgis::listToSet( mVectorLayerCache->mCache.keys() );
60 mFeatureIdIterator = mFeatureIds.constBegin();
62 if ( mFeatureIdIterator == mFeatureIds.constEnd() )
73 while ( mFeatureIdIterator != mFeatureIds.constEnd() )
75 if ( !mVectorLayerCache->mCache.contains( *mFeatureIdIterator ) )
81 f =
QgsFeature( *mVectorLayerCache->mCache[*mFeatureIdIterator]->feature() );
96 mFeatureIdIterator = mFeatureIds.constBegin();
109 , mVectorLayerCache( vlCache )
125 if ( !mFilterRect.
isNull() )
144 mVectorLayerCache->cacheFeature( f );
145 mFids.insert( f.
id() );
167 return mFeatIt.
close();
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
@ FilterFid
Filter using feature ID.
const QgsFeatureIds & filterFids() const
Gets feature IDs that should be fetched.
The cached features can be indexed by QgsAbstractCacheIndex.
QgsCoordinateTransformContext transformContext() const
Returns the transform context, for use when a destinationCrs() has been set and reprojection is requi...
bool acceptFeature(const QgsFeature &feature)
Check if a feature is accepted by this requests filter.
void requestCompleted(const QgsFeatureRequest &featureRequest, const QgsFeatureIds &fids)
Gets called, whenever the full list of feature ids for a certain request is known.
QgsFeatureId filterFid() const
Gets the feature ID that should be fetched.
FilterType filterType() const
Returns the filter type which is currently set on this request.
bool mClosed
Sets to true, as soon as the iterator is closed.
@ FilterFids
Filter using feature IDs.
QgsCoordinateReferenceSystem sourceCrs() const
Returns the coordinate reference system for features in the cache.
void setValid(bool validity)
Sets the validity of the feature.
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination coordinate reference system for feature's geometries, or an invalid QgsCoordi...
QgsFeatureRequest mRequest
A copy of the feature request.
bool close() override
Close this iterator.
bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
QgsRectangle filterRectToSourceCrs(const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException)
Returns a rectangle representing the original request's QgsFeatureRequest::filterRect().
bool close() override
Close this iterator.
bool isValid() const
Returns whether this CRS is correctly initialized and usable.
QgsVectorLayer * layer()
Returns the layer to which this cache belongs.
void geometryToDestinationCrs(QgsFeature &feature, const QgsCoordinateTransform &transform) const
Transforms feature's geometry according to the specified coordinate transform.
QSet< QgsFeatureId > QgsFeatureIds
bool nextFeature(QgsFeature &f)
bool rewind() override
Rewind to the beginning of the iterator.
bool fetchFeature(QgsFeature &f) override
Implementation for fetching a feature.
bool rewind() override
Rewind to the beginning of the iterator.
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
QgsCachedFeatureWriterIterator(QgsVectorLayerCache *vlCache, const QgsFeatureRequest &featureRequest)
This constructor creates a feature iterator, which queries the backend and caches retrieved features.
QgsCachedFeatureIterator(QgsVectorLayerCache *vlCache, const QgsFeatureRequest &featureRequest)
This constructor creates a feature iterator, that delivers all cached features.