This change allows users to choose which method to use when running
the simplify geometries algorithm, with choices of the existing
distance based (Douglas Peucker) algorithm, area based (Visvalingam)
algorithm and snap-to-grid.
Visvaligam in particular usually results in more cartographically
pleasing simplification over the standard distance based methods.
The existing polygoncentroids algorithm has been deprecated
(and hidden from the toolbox), and a new, generic centroids
algorithm added which works with lines and multipoints
Now all evaluate/prepare/etc methods must be called using QgsExpressionContexts
Also remove most remaining traces of special variables. This brings some
user facing changes, such that existing expressions may need to be
updated if they used these old special variables (eg $scale,
$feature). These changes are noted in doc/qgis3_user_changes.dox
so that we can include them in the release notes.
Since the layer has more complete knowledge of the crs (ie, when
provider could not determine crs and user has selected it from
the list), and also better knowledge of layer fields (virtual
fields, joined fields) we should use these rather than the
provider methods.
* Remove deprecated Qgis::WKBType and API cleanup
Renames QgsWKBTypes to QgsWkbTypes
Replaces usage of the enums:
* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType
Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)
Renames some SSLxxx to SslXxx and URIxxx to UriXxx
* Fix build warnings and simplify type handling
* Add a fixer to rewrite imports
* The forgotten rebase conflictThe forgotten rebase conflicts
* QgsDataSourcURI > QgsDataSourceUri
* QgsWKBTypes > QgsWkbTypes
* Qgis.WKBGeom > QgsWkbTypes.Geom
* Further python fixes
* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions
* Fix tests
* Python 3 updates
* [travis] pull request caching cannot be disabled
so at least use it in r/w mode
* Fix python3 print in plugins
Before the algorithm was written to optimise clipping a few
features against thousands of mask features. The revised algorithm
is optimised for clipping thousands of input features against
a few mask features.
Given that this second operation is much more likely, it makes
sense to optimise for this use case.
I've also applied some other optimisations like taking advantage
of spatial indexes on the providers, using prepared geometries
and also only applying an intersection operation if the geometry
isn't wholly contained by the mask geometry.
Benchmarks:
clipping roads layer with 1 million lines against 2 polygons
before: 5 mins 30 seconds
after: 10 seconds
clipping address layer with 5 million points against 2 polygons
before: 50 minutes
after: 30 seconds