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()))
While it's not a QgsFeatureSource subclass (yet), it behaves
just like one so when can run the feature source conformance
test suite over it.
Fix a few minor issues identified by the test suite, and one
potential crash (requesting an invalid id from a cache iterator
crashes qgis)
Previously this was always read from settings when using
QgsGeometryValidator. It's now an explicit argument
when constructing QgsGeometryValidator or calling the
static validation methods, allowing choice of internal/GEOS
validation methods.
Helps remove more QgsSettings use from core.
QgsProcessingFeatureSink, not all QVariant types
Only strings/QgsPropertys are valid anyway, so instead of strings
use static properties. This makes it clearer what possible
values are permitted for the underlying source/sink definition.
flexible QVariantMap creatOptions parameters which include an
optional fileEncoding value
More flexible, allows sinks to be created using any creation
option which is passed to the underlying provider
input to a processing algorithm.
This allows parameter inputs to encapsulate extra information
relating to a feature source input, such as whether only
selected features from the source layer should be used.
Instead, parameters evaluate to QgsFeatureSource, which are
used for retrieving features, feature count, crs, wkb type,
etc.
This abstracts away the actual feature source, so that
algorithms may potentially operate from non-layer
feature sources.
It also helps remove the need for specialised QgsProcessingUtils
methods like getFeatures, featureCount, and createSpatialIndex.
Instead the standard API methods using QgsFeatureSources can
be used instead.
input to a processing algorithm.
This allows parameter inputs to encapsulate extra information
relating to a feature sink input, such as destination file
encoding and whether the sink layer should be loaded into
the project on completion