[QGIS-Developer] WKT from QgsGeometry incompatible with OGR

Nyall Dawson nyall.dawson at gmail.com
Thu Jul 4 13:30:05 PDT 2024


On Thu, 4 July 2024, 11:19 pm Ivan Barsukov via QGIS-Developer, <
qgis-developer at lists.osgeo.org> wrote:

> Hi everyone!
>
> Could you please tell me why the QgsGeometry::asWkt method returns the
> names of geometry types with the Z coordinate without a space (PointZ
> instead of Point Z, etc.)? This value is not compatible with ogr.
>


Both formats are compliant with the WKT specifications. This should rather
be filed as a feature request for GDAL to support the forms without a space.

Nyall


> A minimal example is below. Executing it will return an exception:
> "RuntimeError: OGR Error: Corrupt data"
>
> from osgeo import ogr
>
> qgis_geometyry = QgsGeometry().fromWkt("POINT Z (0 0 0)")
> wkt = qgis_geometyry.asWkt() # 'PointZ (0 0 0)'
> ogr.CreateGeometryFromWkt(wkt)
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240705/61552d3e/attachment.htm>


More information about the QGIS-Developer mailing list