[QGIS-Developer] WKT from QgsGeometry incompatible with OGR
Nyall Dawson
nyall.dawson at gmail.com
Sat Jul 6 02:02:52 PDT 2024
On Sat, 6 July 2024, 4:56 pm Even Rouault, <even.rouault at spatialys.com>
wrote:
> 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
>
Hmmmm.... What about the examples in 6.1.2.6.4?
Nyall
> .
>
> 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 listQGIS-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/617a2df3/attachment-0001.htm>
More information about the QGIS-Developer
mailing list