7

从 GeoDjango Point Field,我得到以下几点:

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.45km 的距离

为什么会有这么大的差异?

4

1 回答 1

13

您的纬度/经度方向错误。尝试:

p1 = Point("53.4235217000000020 -113.4741271000000040")
p2 = Point("53.5343457999999970 -113.5013688000000229")

给我结果= 12.466096663282977

于 2012-06-13T05:02:00.187 回答