计算距坐标最近的位置
假设我有一个位置列表(坐标)和一个位置(同样,坐标),我可以根据位置与该位置的距离对位置列表进行排序吗?
我想知道 Python 和 OpenStreetMap 是否可以实现这一点。
Let's say I had a list of locations (the coordinates) and one location (again, coordinates), can I sort the list of locations depending on how close they are to the location?
I'm wondering if this is possible with Python and OpenStreetMap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,假设每个位置都是一个具有纬度和经度的点,如
(2, 3)
。因此,您的列表将是:您的位置将是:
那么您的工作是计算从列表
x
到您的位置y
的位置之间的距离:Well, let's say each location is a point with lat and long like
(2, 3)
. So your list would be:Your location would be:
Then your job is to calculate the distance between locations from the list
x
to your locationy
: