[gdal-dev] UTM local correction for height and distance-to-reference-meridian ?

Even Rouault even.rouault at spatialys.com
Tue Jan 21 07:23:34 PST 2025


> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250121/06e8137a/attachment.htm>


More information about the gdal-dev mailing list