2
$\begingroup$

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.

Thanks!

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

$\endgroup$
3
$\begingroup$

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

http://www.movable-type.co.uk/scripts/latlong.html

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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