我只是想使用谷歌地圖API來獲取路線/從A點方向到B點,考慮到經/緯A的座標,通過谷歌地圖API的路線和B.我想用Python做這個。使用LAT /長源和目標來獲得在Python
如果我做這樣的事情,它的工作原理:
import googlemaps
gmaps = googlemaps.Client(key='mykey')
start = 'Constitution Ave NW & 10th St NW, Washington, DC'
end = 'Independence and 6th SW, Washington, DC 20024, USA'
dirs = gmaps.directions(start, end)
然而,這不是我想要的,因爲我只有經/緯度座標,而不是地址。我知道我可以使用reverse_geocode()將lat/long轉換爲地址,但這不是我想要的,因爲這將調用Directions API的頂部的Geocoding API。我還沒有找到一種方法直接使用lat/long上的gmaps.directions()。
所以我的問題很簡單:當我只有A和B的緯度/經度座標時,我可以單獨使用Directions API來獲取從A點到B點的方向嗎?或者我有義務在其上使用Geocoding API?
謝謝你的時間。
Downvoted甚至沒有留下評論? – en1