[QGIS-Developer] WKT from QgsGeometry incompatible with OGR
Even Rouault
even.rouault at spatialys.com
Sat Jul 6 04:09:34 PDT 2024
I've went ahead and added support for PointZ like WKT strings in OGR in
https://github.com/OSGeo/gdal/pull/10370, but it would be probably
better that QGIS writes conformant WKT by default (I suspect that fixing
this has the potential of breaking a number of tests though)
Le 06/07/2024 à 08:56, Even Rouault via QGIS-Developer a écrit :
> 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.
>
> _______________________________________________
> 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/113f4f7d/attachment-0001.htm>
More information about the QGIS-Developer
mailing list