By moving logic to abstract geometry subclasses so that they
can trivially retrieve the vertex number, instead of relying
on the inefficient coordinateSequence method.
Has flow on speed boosts to many geometry operations like
calculation of closest points in a geometry, which will
benefit snapping related operations.
Previously the method in QgsGeometryUtils was relying on
QgsAbstractGeometry::coordinateSequence, which is an absolute
performance killer.
Instead move to optimised methods in the various abstract
geometry subclasses which rely only on trivial calculations.
Previously the writer was only using transactions in some
cases (when calling the static writeAsVectorFormat method).
This changes the writer to always use a transaction when
possible.
Fixes the map renderer job test using gpkg from timing out after
taking forever to running twice the speed of the shapefile
version. Similar benefits across other parts of qgis,
which are writing files without using the static method, e.g.
processing.
Currently each time you instanciate a QgsOgrProvider layer, a GDAL dataset is
created. In the case of GeoPackage, this means a SQLite connection and a file
handle. As GDAL enables Spatialite function on GeoPackage connections, we are
bound to Spatialite limits, and Spatialite has a hard limit on a maximum of
64 simultaneous connections. Thus we cannot open more than 64 layers of the
same GeoPackage.
This commits enables sharing of the same GDALDataset object among several
QgsOgrProvider object. Care is made to reuse a GDALDataset object only if the
QgsOgrProvider do not point to the same layer. Mutexes are also taken to
allow safe instanciation and use of QgsOgrProvider objects from multiple
threads (but a same QgsOgrProvider should not be used by more than one thread
at a time)
With this commit, it's posssible to handle a request from a QgsProject without writing it to the disk.
```python
server = QgsServer()
project = QgsProject()
vlayer = QgsVectorLayer("/path/to/shapefile/file.shp", "layer_name_you_like", "ogr")
project.addMapLayer(vlayer)
query_string = 'https://www.qgis.org/?SERVICE=WMS&VERSION=1.3&REQUEST=GetCapabilities'
request = QgsBufferServerRequest(query_string, QgsServerRequest.GetMethod, {}, data)
response = QgsBufferServerResponse()
server.handleRequest(request, response, project)
```
This change ensures that searching for algorithms always returns
native algorithms before matching 3rd party algorithms
TODO: we really need to replace the toolbox tree with a proper
model and redo the sorting/filtering using a sort/filter proxy
model.