I am currently trying to calculate the geographic distance between two regions as I want to correlate it with their similarity of another aspect (e.g., similarity in word usage).

Currently, I have used a simple approach of determining the geographic center point of each region (a region corresponds to a province/state of a country) and then calculate the Haversine distance [1] between these two points.

This approach seems rather ad-hoc to me and as I am no expert in this area, I am curious if you guys know a more reasonable approach.


[1] http://en.wikipedia.org/wiki/Haversine_formula


1 Answer 1


The Haversine formula is really the best way to calculate distances on the Earth unless you have outstanding accuracy concerns. The next step passed the Haversine involves taking into account that the Earth is not a sphere but ellipsoidal and which involves a much more expensive computation.

There's a good page with some embedded javascript at


that provides some explanation of issues involved and some alternatives such as the law of cosines (less accurate but faster than the Haversine formula).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.