Python's geopy package features two distance measurements techniques: Great Circle and Vincenty's formulae.
>>> from geopy.distance import great_circle
>>> from geopy.distance import vincenty
>>> p1 = (31.8300167,35.0662833) # (lat, lon) - https://goo.gl/maps/TQwDd
>>> p2 = (31.8300000,35.0708167) # (lat, lon) - https://goo.gl/maps/lHrrg
>>> vincenty(p1, p2).meters
429.16765838976664
>>> great_circle(p3, p4).meters
428.4088367903001
What is the difference? Which distance measurement is preferred?
Best Answer
According to Wikipedia, Vincenty's formula is slower but more accurate:
The accuracy difference is
~0.17%
in a 428 meters distance in Israel. I've made a quick-and-dirty speed test:Code:
To conclude: Vincenty's formula is doubles the calculation time compared to great-circle, and its accuracy gain at the point tested is ~0.17%.
Since the calculation time is negligible, Vincenty's formula is preferred for every practical need.
Update: Following the insightful comments by whuber and cffk's and cffk's answer, I agree that the accuracy gain should be compared with the error, not the measurement. Hence, Vincenty's formula is a few orders of magnitude more accurate, not ~0.17%.