[QGIS-Developer] WKT from QgsGeometry incompatible with OGR

Andrea Giudiceandrea andreaerdna at libero.it
Sat Jul 6 03:34:19 PDT 2024


Il 06/07/2024 10:33, Jorge Gustavo Rocha via QGIS-Developer ha scritto:
>  >>> import shapely
>  >>> shapely.to_wkt(shapely.Point(0, 0, 0))
> 'POINT Z (0 0 0)'
>  >>> shapely.from_wkt('POINT Z (0 0 0)')
> <POINT Z (0 0 0)>

Anyway, it looks like also "PointZ" and "PointM" (besides "POINT Z" and 
"POINT M") are recognised by shapely (2.0.3 with GEOS 3.12.2):

 >>> shapely.from_wkt('PointZ (0 0 0)')
<POINT Z (0 0 0)>
 >>> shapely.from_wkt('PointM (0 0 0)')
<POINT M (0 0 0)>

Moreover, ogr (OGR/GDAL 3.9.1) recognises "PointM" (but not "PointZ"):

 >>> ogr.CreateGeometryFromWkt('PointM (0 0 0)').ExportToIsoWkt()
'POINT M (0 0 0)'


Regards.

Andrea


More information about the QGIS-Developer mailing list