require all input layers to be in the same CRS
The default behaviour is to assume that algorithms are well behaved
and can handle multi-CRS inputs, but algs have the option to
flag that they do not allow this and require the input CRS check.
Those algs should document that they require all inputs to have
matching CRS - processing 3.0 behaviour is to assume that algs
can handle this.
Geometries are passed as const reference and returned by value.
This make using the API easier and reduces the risk of ownership
problems.
The overhead is minimal due to implicit sharing.
Fix https://github.com/qgis/qgis3.0_api/issues/68
This adds a lot of flexibility to algorithms, as it makes output
sinks truely optional. For instance, the various "Extract by..."
algorithms could add a new optional sink for features which
'fail' the extraction criteria. This effectively allows these
algorithms to become feature 'routers', directing features onto
other parts of a model depending on whether they pass or fail
the test.
But in this situation we don't always care about these failing
features, and we don't want to force them to always be fetched
from the provider. By making the outputs truely optional,
the algorithm can tweak its logic to either fetch all features
and send them to the correct output, or only fetch
matching features from the provider in the first place (a big
speed boost).
Flip all scale based widgets to use scale denominators instead
of actual scales (ie 100.0 instead of 0.01 for 1:100).
This is done for consistency with the rest of the API, which
predominantly uses scale denominators. It also helps
precision loss as a result of multiple 1.0 / scale conversions
throughout the code.
Refs #15337
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)
Run the feature source tests over a layer with added, edited
geometries, and edited attributes unsaved in an edit buffer
Fix identified issues when iterating over these edited features
I have got caught by the default set to WGS 84 when I loaded a layer
in projected CRS, set extent to layer's extent and... nothing got rendered
because map renderer was reprojecting to WGS 84.
This default is closer to the default in 2.x where reprojection is turned off.