Closed wonder-sk closed 7 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.
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.