[QGIS-Developer] WKT from QgsGeometry incompatible with OGR

Jorge Gustavo Rocha jgr at di.uminho.pt
Sat Jul 6 08:07:07 PDT 2024


Hi Even,

I already saw your PR. It is really nice to all our tools talking 
smoothly to each other. Thanks for the improvement.

Seems like quite easy to change QGIS code. The major impact are these 15 
tests:

         227 - test_core_geometry_circularstring (Failed)
         228 - test_core_geometry_compoundcurve (Failed)
         229 - test_core_geometry_curvepolygon (Failed)
         231 - test_core_geometry_linestring (Failed)
         232 - test_core_geometry_multicurve (Failed)
         233 - test_core_geometry_multilinestring (Failed)
         234 - test_core_geometry_multipoint (Failed)
         235 - test_core_geometry_multipolygon (Failed)
         236 - test_core_geometry_multisurface (Failed)
         237 - test_core_geometry_point (Failed)
         239 - test_core_geometry_polygon (Failed)
         240 - test_core_geometry_quadrilateral (Failed)
         243 - test_core_geometry_triangle (Failed)
         244 - test_core_geometry (Failed)
         245 - test_core_geometrycollection (Failed)

I'll take a look at them and provide more feedback.

Regards,

Jorge

On 06/07/24 12:09, Even Rouault via QGIS-Developer wrote:
>
> 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.
>
> _______________________________________________
> 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/20240706/aeee482e/attachment.htm>


More information about the QGIS-Developer mailing list