QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
#include <qgsvectorlayerfeatureiterator.h>
Classes | |
struct | FetchJoinInfo |
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes(). More... | |
Public Member Functions | |
QgsVectorLayerFeatureIterator (QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request) | |
~QgsVectorLayerFeatureIterator () override | |
bool | close () override |
end of iterating: free the resources / lock More... | |
bool | isValid () const override |
Returns if this iterator is valid. More... | |
bool | rewind () override |
reset the iterator to the starting position More... | |
void | setInterruptionChecker (QgsFeedback *interruptionChecker) override |
Attach an object that can be queried regularly by the iterator to check if it must stopped. More... | |
Public Member Functions inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource > | |
QgsAbstractFeatureIteratorFromSource (QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request) | |
~QgsAbstractFeatureIteratorFromSource () override | |
Public Member Functions inherited from QgsAbstractFeatureIterator | |
QgsAbstractFeatureIterator (const QgsFeatureRequest &request) | |
base class constructor - stores the iteration parameters More... | |
virtual | ~QgsAbstractFeatureIterator ()=default |
destructor makes sure that the iterator is closed properly More... | |
virtual bool | close ()=0 |
end of iterating: free the resources / lock More... | |
bool | compileFailed () const |
Indicator if there was an error when sending the compiled query to the server. More... | |
CompileStatus | compileStatus () const |
Returns the status of expression compilation for filter expression requests. More... | |
virtual bool | isValid () const |
Returns if this iterator is valid. More... | |
virtual bool | nextFeature (QgsFeature &f) |
fetch next feature, return true on success More... | |
virtual bool | rewind ()=0 |
reset the iterator to the starting position More... | |
virtual void | setInterruptionChecker (QgsFeedback *interruptionChecker) |
Attach an object that can be queried regularly by the iterator to check if it must stopped. More... | |
Protected Member Functions | |
void | addExpressionAttribute (QgsFeature &f, int attrIndex) |
Adds an expression based attribute to a feature. More... | |
void | addJoinedAttributes (QgsFeature &f) |
void | addVirtualAttributes (QgsFeature &f) |
Adds attributes that don't source from the provider but are added inside QGIS Includes. More... | |
bool | fetchFeature (QgsFeature &feature) override |
fetch next feature, return true on success More... | |
bool | fetchNextAddedFeature (QgsFeature &f) |
bool | fetchNextChangedAttributeFeature (QgsFeature &f) |
bool | fetchNextChangedGeomFeature (QgsFeature &f) |
bool | nextFeatureFid (QgsFeature &f) |
bool | nextFeatureFilterExpression (QgsFeature &f) override |
Overrides default method as we only need to filter features in the edit buffer while for others filtering is left to the provider implementation. More... | |
void | prepareExpression (int fieldIdx) |
void | prepareField (int fieldIdx) |
void | prepareFields () |
void | prepareJoin (int fieldIdx) |
bool | prepareSimplification (const QgsSimplifyMethod &simplifyMethod) override |
Setup the simplification of geometries to fetch using the specified simplify method. More... | |
void | rewindEditBuffer () |
void | updateChangedAttributes (QgsFeature &f) |
Update feature with uncommitted attribute updates. More... | |
void | updateFeatureGeometry (QgsFeature &f) |
Update feature with uncommitted geometry updates. More... | |
void | useAddedFeature (const QgsFeature &src, QgsFeature &f) |
void | useChangedAttributeFeature (QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f) |
Protected Member Functions inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource > | |
void | iteratorClosed () |
to be called by from subclass in close() More... | |
Protected Member Functions inherited from QgsAbstractFeatureIterator | |
void | deref () |
Remove reference, delete if refs == 0. More... | |
virtual bool | fetchFeature (QgsFeature &f)=0 |
If you write a feature iterator for your provider, this is the method you need to implement!! More... | |
QgsRectangle | filterRectToSourceCrs (const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException) |
Returns a rectangle representing the original request's QgsFeatureRequest::filterRect(). More... | |
void | geometryToDestinationCrs (QgsFeature &feature, const QgsCoordinateTransform &transform) const |
Transforms feature's geometry according to the specified coordinate transform. More... | |
virtual bool | nextFeatureFilterExpression (QgsFeature &f) |
By default, the iterator will fetch all features and check if the feature matches the expression. More... | |
virtual bool | nextFeatureFilterFids (QgsFeature &f) |
By default, the iterator will fetch all features and check if the id is in the request. More... | |
virtual bool | prepareSimplification (const QgsSimplifyMethod &simplifyMethod) |
Setup the simplification of geometries to fetch using the specified simplify method. More... | |
void | ref () |
Add reference. More... | |
RequestToSourceCrsResult | updateRequestToSourceCrs (QgsFeatureRequest &request, const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException) |
Update a QgsFeatureRequest so that spatial filters are transformed to the source's coordinate reference system. More... | |
Protected Attributes | |
QgsFeatureIterator | mChangedFeaturesIterator |
QgsFeatureRequest | mChangedFeaturesRequest |
double | mDistanceWithin = 0 |
std::shared_ptr< QgsGeometryEngine > | mDistanceWithinEngine |
QgsGeometry | mDistanceWithinGeom |
QMap< int, QgsExpression * > | mExpressionFieldInfo |
QgsFeatureMap::ConstIterator | mFetchAddedFeaturesIt |
QgsGeometryMap::ConstIterator | mFetchChangedGeomIt |
QSet< QgsFeatureId > | mFetchConsidered |
bool | mFetchedFid |
QMap< const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo > | mFetchJoinInfo |
Information about joins used in the current select() statement. More... | |
QgsRectangle | mFilterRect |
bool | mHasValidTransform = false |
bool | mHasVirtualAttributes |
QgsFeatureIterator | mProviderIterator |
QgsFeatureRequest | mProviderRequest |
QgsCoordinateTransform | mTransform |
Protected Attributes inherited from QgsAbstractFeatureIteratorFromSource< QgsVectorLayerFeatureSource > | |
bool | mOwnSource |
QgsVectorLayerFeatureSource * | mSource |
Protected Attributes inherited from QgsAbstractFeatureIterator | |
bool | mClosed = false |
Sets to true , as soon as the iterator is closed. More... | |
bool | mCompileFailed = false |
CompileStatus | mCompileStatus = NoCompilation |
Status of compilation of filter expression. More... | |
long long | mFetchedCount = 0 |
Number of features already fetched by iterator. More... | |
QgsFeatureRequest | mRequest |
A copy of the feature request. More... | |
bool | mValid = true |
An invalid state of a feature iterator indicates that there was a problem with even getting it up and running. More... | |
bool | mZombie = false |
A feature iterator may be closed already but still be serving features from the cache. More... | |
int | refs = 0 |
reference counting (to allow seamless copying of QgsFeatureIterator instances) More... | |
Additional Inherited Members | |
Public Types inherited from QgsAbstractFeatureIterator | |
enum | CompileStatus { NoCompilation , PartiallyCompiled , Compiled } |
Status of expression compilation for filter expression requests. More... | |
enum class | RequestToSourceCrsResult : int { Success , DistanceWithinMustBeCheckedManually } |
Possible results from the updateRequestToSourceCrs() method. More... | |
Definition at line 157 of file qgsvectorlayerfeatureiterator.h.
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator | ( | QgsVectorLayerFeatureSource * | source, |
bool | ownSource, | ||
const QgsFeatureRequest & | request | ||
) |
Definition at line 137 of file qgsvectorlayerfeatureiterator.cpp.
|
override |
Definition at line 370 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Adds an expression based attribute to a feature.
f | feature |
attrIndex | attribute index |
Definition at line 1122 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 1065 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Adds attributes that don't source from the provider but are added inside QGIS Includes.
f | The feature will be modified |
Definition at line 1082 of file qgsvectorlayerfeatureiterator.cpp.
|
overridevirtual |
end of iterating: free the resources / lock
Implements QgsAbstractFeatureIterator.
Definition at line 604 of file qgsvectorlayerfeatureiterator.cpp.
|
overrideprotectedvirtual |
fetch next feature, return true
on success
Implements QgsAbstractFeatureIterator.
Definition at line 468 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 628 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 714 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 675 of file qgsvectorlayerfeatureiterator.cpp.
|
overridevirtual |
Returns if this iterator is valid.
An invalid feature iterator is not able to provide a reliable source for data. If an iterator is invalid, either give up or try to send the request again (preferably after a timeout to give the system some time to stay responsive).
If you want to check if the iterator successfully completed, better use QgsFeatureIterator::isClosed().
Reimplemented from QgsAbstractFeatureIterator.
Definition at line 623 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 1264 of file qgsvectorlayerfeatureiterator.cpp.
|
inlineoverrideprotectedvirtual |
Overrides default method as we only need to filter features in the edit buffer while for others filtering is left to the provider implementation.
Reimplemented from QgsAbstractFeatureIterator.
Definition at line 226 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 838 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 1043 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 897 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 796 of file qgsvectorlayerfeatureiterator.cpp.
|
overrideprotectedvirtual |
Setup the simplification of geometries to fetch using the specified simplify method.
Reimplemented from QgsAbstractFeatureIterator.
Definition at line 1141 of file qgsvectorlayerfeatureiterator.cpp.
|
overridevirtual |
reset the iterator to the starting position
Implements QgsAbstractFeatureIterator.
Definition at line 586 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 788 of file qgsvectorlayerfeatureiterator.cpp.
|
overridevirtual |
Attach an object that can be queried regularly by the iterator to check if it must stopped.
This is mostly useful for iterators where a single nextFeature()/fetchFeature() iteration might be very long. A typical use case is the WFS provider. When nextFeature()/fetchFeature() is reasonably fast, it is not necessary to implement this method. The default implementation does nothing.
Reimplemented from QgsAbstractFeatureIterator.
Definition at line 617 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Update feature with uncommitted attribute updates.
Definition at line 1309 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Update feature with uncommitted geometry updates.
Definition at line 1332 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 658 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 750 of file qgsvectorlayerfeatureiterator.cpp.
|
protected |
Definition at line 297 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 296 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 307 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 306 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 305 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 322 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 312 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 311 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 310 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 314 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Information about joins used in the current select() statement.
Allows faster mapping of attribute ids compared to mVectorJoins.
Definition at line 320 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 300 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 301 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 324 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 295 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 294 of file qgsvectorlayerfeatureiterator.h.
|
protected |
Definition at line 302 of file qgsvectorlayerfeatureiterator.h.