[QGIS-Developer] WKT from QgsGeometry incompatible with OGR

Even Rouault even.rouault at spatialys.com
Fri Jul 5 23:56:24 PDT 2024


Hi,
>
> Both formats are compliant with the WKT specifications.

Are they? I may have missed something in the Simple Features spec, but 
looking at https://portal.ogc.org/files/?artifact_id=25355 , I can't see 
where it would allow the form {geometryTypeName}Z without a space 
between {geometryTypeName} and Z.

For example the BNF at page 56 shows:

<point z tagged text> ::= point z <point z text>

The examples at page 62 also show a space.

Even

>
> 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
>
>
> _______________________________________________
> 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

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240706/784a0722/attachment.htm>


More information about the QGIS-Developer mailing list