[PROJ] Explaining geodesic distance discrepancies

Dima Kogan proj at dima.secretsauce.net
Fri May 15 13:12:25 PDT 2020


Hi. I'm seeing behavior I don't understand. Any clarification would be
greatly appreciated.

I have two positions represented as latitude,longitude pairs, and I'm
trying to get the distance between them. I've 3 methods that all yield
different results, where I think they should be VERY close. The methods
are:

- Converting the lat/lon to a Cartesian UTM system, and then using the
  Cartesian distance

- pyproj.Geod

- The "geod" command-line tool

For an arbitrary pair of points that are ~1km apart, I see:

diff utm:          1161.43346448816
diff geod:         1161.1017567084384
diff geod cmdline: 1163.971

This looks wrong. The UTM probably should be slightly off because the
two Cartesian systems are slightly tilted, but is 30cm over 1km really
how far off it should be?

The difference between pyproj.Geod and the "geod" cmdline tool makes
even less sense. In theory they're doing the same thing, so the results
should be identical.

I'm attaching a Python script to run the 3 methods, and print the
ranges.

Thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst.py
Type: text/x-python
Size: 944 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20200515/0acebba9/attachment.py>


More information about the PROJ mailing list