我在网上搜资料,从中我得到了一个地点的清单。我要把经度和经度分别转换。我找到了geopy
它看起来做得很好。在
无论是否有geopy
,如何从Python 3.5
内将该列表转换为它们各自的坐标(lon: (from -180,180) and lat: (from -90,90))
?
最好是精确的坐标,但如果不可能,一般的区域坐标也可以。在
我找到了我试图模仿的资源https://pypi.python.org/pypi/geopy
#Convert to Longitude/Latitude
from geopy.geocoders import Nominatim
geolocator = Nominatim()
locations = ['Kahekili Beach/Old Airport Beach, Leeward Shore Maui', 'Outside Honokohau Harbor South / Naia / Ripoff Reef, North Kona Coast', 'Ulua Beach, Leeward Shore Maui', 'Kaiwi Pt./Arch Cave/Wash Rock/Sand Channel/Kamanu/Devils Doorway, North Kona Coast', 'Honolua Bay MLCD, Leeward Shore Maui', 'Golden Arches', 'Lone Tree Arch / Freeze Face Cave, North Kona Coast', 'Old Airport', 'Turtle Heaven, North Kona Coast', 'Turtle Pinnacle/Turtle Towers/North of Honokohau Harbor Entrance/Terrapin Station/Turtle Pai, North Kona Coast']
for location in locations:
location = geolocator.geocode(location)
Error
+Service timed out
目前没有回答
相关问题 更多 >
编程相关推荐