从 GeoDjango 点字段中,我得到了以下点:
object1.point = "POINT(-113.4741271000000040 53.4235217000000020)"
object2.point = "POINT(-113.5013688000000229 53.5343457999999970)"
然后我使用geopy
计算距离:
from geopy import distance
from geopy import Point
p1 = Point("-113.4741271000000040 53.4235217000000020")
p2 = Point("-113.5013688000000229 53.5343457999999970")
result = distance.distance(p1,p2).kilometers
print result
# 5.791490830933827
但使用这个工具:http://www.movable-type.co.uk/scripts/latlong.html,我得到了一个距离为12.45公里。
为什么会有这么大的差异呢?