This is potentially interesting for race conditions, but whenever it is specified,
iterators will need to be carefully checked for validity and error handling needs
to be taken care of.
If set, all geometries will be reprojected from their original
coordinate reference system to the destination CRS while
iterating over features.
If a CRS has been set as the destination CRS, then the filterRect
parameter should be specified in the same CRS as this destination
CRS.
Additionally, a callback function can be specified on the request
to be called if a transform exception is encountered while
iterating over features.
This is designed to make it easier for scripts and plugins to
correctly reproject layers in an efficient and robust way, instead
of having to implement lots of repeated code themselves and
potentially missing some of the important considerations which
come with reprojecting geometries & bounding boxes.
Now, if a script wants the features from a layer in a specific
CRS, they can call:
crs = QgsCoordinateReferenceSystem('epsg:4326')
request = QgsFeatureRequest().setDestinationCrs(crs)
for f in layer.getFeatures(reqeuest):
print('geometry in 4326 is {}.format(f.geometry().exportToWkt()))
Vector data provider now has getFeatures() method to access features.
select(), nextFeature(), featureAtId(), rewind() were removed resp. moved to provider's feature iterator implementations.
Providers that currently do not implement the new API were disabled.