Feature request #7706
Geometry constructors (EWKT/EWKB)
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||16617|
Right now, only WKT/WKB can be used to import/export geometries.
It would be great to have EWKT and EWKB import/export methods, to avoid complex stuff as in 
#1 Updated by Matthias Kuhn about 6 years ago
I discussed this topic a while ago on IRC with jef.
The main point for not including this was, that the SRID must not be lost within this process. When loading as geometry column in a layer, this information is preserved in the layer SRID, but the geometry itself has no such variable.I see two approaches to this:
- specifying the SRID as additional parameter for QgsGeometry::exportToEWk[t|b]( int SRID ) and passing an additional reference int& SRID to QgsGeometry::fromToEWk[t|b]() where the SRID will be written to.
- creating a new class QgsReferencedGeometry (or QgsEGeometry as in *E*WKT) which inherits QgsGeometry and holds an additional variable for the SRID.