我不确定这是可能的,但我有一个城市坐标列表,然后我想取列表中的第一个坐标并计算列表中每个坐标的距离,最后我想得到最短距离和城市名。除了获取城市名称和州外,我可以做所有的事情。有没有办法做到这一点?
from geopy.geocoders import GoogleV3
from geopy.distance import vincenty
geolocator = GoogleV3()
cord_places = [(41.6592776, -76.7503693), (37.7792768, -122.4192704), (42.3486635, -83.0567375)
first = cord_places[0];
cord_places.remove(first)
print distance(first, cord_places)
def distance(first, cord_places):
for ct in cord_paces
dist = vincenty((first), (ct))#this gives me all the distances between first city and the others in the list but I would like to know which city it was
return dist
有人有任何提示吗?