qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

Remove WKB representation from QgsGeometry #15

Closed wonder-sk closed 7 years ago

wonder-sk commented 8 years ago

QgsGeometry still keeps WKB for backward compatibility, increasing memory footprint.

WKB should be kept just as import/export format, but not as an ordinary representation of geometries. Other parts of QGIS should stop using WKB representation and just use "native" geometry classes to access/modify geometries.

m-kuhn commented 8 years ago

QgsGeometry as a container for geometries should IMO bring the possibility to cache geometries in various formats for different backends.

In particular I think that if several geos operations are performed subsequently, converting it back and forth several times seems an unnecessary overhead (e.g. nested expressions).

Such geometry formats for interfaces should only be created on request (or if they are the original source for construction).

In places in the code where we know it's not required to keep them we can just use QgsAbstractGeoemtryV2* which has no caching or other overhead. We should still write all our own code on the internal representation so there is no requirement to create a WKB (or other) representation as long as it's not required to interface with external libraries.

nyalldawson commented 7 years ago

Fixed in https://github.com/qgis/QGIS/commit/d729951dcd13ed38d71ab2b850d1673bd794a569