I fail to use the outcome of scipy
's pdist
function. I am interested in the real geographic distance (preferred unit: km). Take the following coordinates:
from scipy.spatial.distance import pdist
coordinates = [ (42.057, -71.08), (39.132, -84.5155) ]
distance = pdist(coordinates)
print distance
# [ 13.75021037]
But what's the unit? Google says the distance between these two points is 1179 km. How do I get there from 13.75021037?
pdist
, AFAICT, doesn't have any way to read the coordinates as lat-long. It's taking them as vectors in (AFAICT) R^n. I believe you want to look for spherical distance or great circle distance. – Anemic