Now the same with ogrinfo. I simplified the SQL by  saving the test linesting into a file in EPSG:3067.

ogrinfo -dialect sqlite -sql "select ST_Length(geometry) from length" length.json
208808.794960845

Good so far. But with “use_ellipsoid” gives very unexpected result:


ogrinfo -dialect sqlite -sql "select ST_Length(geometry,1) from length" length.json

417750.100376289

Same wrong result also with this:

ogrinfo -dialect sqlite -sql "select ST_Length(ST_Transform(geometry,4326),1) from length" length.json

length.json is this:

Jukka,

Thanks for the feedback. ST_Length(geometry, use_ellipsoid=1) is indeed seriously broken in GDAL 3.10 as it only properly works on closed linestrings / polygons

Fix in https://github.com/OSGeo/gdal/pull/11700

With it,

$ ogrinfo -dialect sqlite -sql "select ST_Length(geometry, 1) from test" test.json -al -q

Layer name: SELECT
OGRFeature(SELECT):0
  ST_Length(geometry, 1) (Real) = 208875.050188144

Even


--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to