[gdal-dev] Ellipsoidal length of a line
mwtoews at gmail.com
Sun Jun 16 14:46:20 PDT 2019
On Sat, 15 Jun 2019 at 03:32, Nicolas Cadieux
<nicolas.cadieux at archeotec.ca> wrote:
> I am trying to get the length of a line in python. (Not just the straight length between the first and last nodes). Using geopandas, (therefore the Shapely lib) I am getting the euclidien distance even though the dataframe holdings the line geometries has a CRS (WGS84, zone UTM 18 S). Obviously, the WGS84 Ellipsoid is not taken into account.
> Can I do this with gdal/ogr?
If you are looking for a really precise length (~15 nm) on WGS84, you
can use the Python version of GeographicLib .
Note that PROJ incorporates the C library for Geodesics from
GeographicLib , and that this is also the same method used in
PostGIS (since version 2.2). I'm not sure how SpatiaLite has
implemented ST_Length, but could be worth checking into.
More information about the gdal-dev