Class: QgsFeatureIterator¶
Wrapper for iterator of features from vector data provider or vector layer.
Methods
Call to end the iteration. |
|
Indicator if there was an error when sending the compiled query to the server. |
|
Returns the status of expression compilation for filter expression requests. |
|
find out whether the iterator is still valid or closed already |
|
Will return if this iterator is valid. |
|
Fetch next feature and stores in f, returns |
|
Resets the iterator to the starting position. |
- class qgis.core.QgsFeatureIterator[source]¶
Bases:
object
- __init__()
Construct invalid iterator
- __init__(iter: QgsAbstractFeatureIterator | None)
Construct a valid iterator
- Parameters:
iter (Optional[QgsAbstractFeatureIterator])
- __init__(fi: QgsFeatureIterator)
Copy constructor copies the iterator, increases ref.count
- Parameters:
fi (QgsFeatureIterator)
- close(self) bool [source]¶
Call to end the iteration. This frees any resources used by the iterator.
- Return type:
bool
- compileFailed(self) bool [source]¶
Indicator if there was an error when sending the compiled query to the server. This indicates that there is something wrong with the expression compiler.
Added in version 3.2.
- Return type:
bool
- compileStatus(self) QgsAbstractFeatureIterator.CompileStatus [source]¶
Returns the status of expression compilation for filter expression requests.
- Return type:
- isClosed(self) bool [source]¶
find out whether the iterator is still valid or closed already
- Return type:
bool
- isValid(self) bool [source]¶
Will return if this iterator is valid. An invalid iterator was probably introduced by a failed attempt to acquire a connection or is a default constructed iterator.
See also
isClosed()
to check if the iterator successfully completed and returned all the features.- Return type:
bool
- nextFeature(self, f: QgsFeature) bool [source]¶
Fetch next feature and stores in
f
, returnsTrue
on success.- Parameters:
f (QgsFeature)
- Return type:
bool