Feature request #7706

Geometry constructors (EWKT/EWKB)

Added by Denis Rouzaud over 4 years ago. Updated 6 months ago.

Status:Open
Priority:High
Assignee:-
Category:Vectors
Pull Request or Patch supplied:No Resolution:
Easy fix?:No

Description

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 [0]

[0] https://github.com/elpaso/quickwkt/blob/73870168d09589a9ab8d54f7d695e548c26e7751/QuickWKT.py#L144

History

#1 Updated by Matthias Kuhn over 4 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.

#2 Updated by Giovanni Manghi 6 months ago

  • Easy fix? set to No

Also available in: Atom PDF