Get stopover towns using the Google Maps API (directions)

左心房为你撑大大i 提交于 2019-11-28 07:39:06

What I would do:

  1. Use the RouteBoxer to find bounds containing the route (fairly small ones)
  2. Use the Places API to return Places of types of city_hall, local_government_office or library (maybe tune that choice a little) inside those bounds.
  3. Take the town data out of those responses, sort them for unique results, then use those.

Proof of concept, will require tuning for types of locations, distance and area where you are doing the search. Depending on the use and the length of the route, it might be better to use the reverse geocoder on points at some regular interval along the road (100 meters or 1000 meters), that might be quicker and won't use up the Places API quota.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!