Google Api Get nearest locations

南楼画角 提交于 2019-12-04 08:15:15

问题


I want to get the List of nearest locations of by passing an address of location. like: Los Angeles, should give me the list of all locations near to it either in json or xml format Is there any Google api for that purpose?


回答1:


Google Places API has lists of places near a given point. For example you can search for bookshops near Convent Garden, London, UK. A good example can be found in the Google Maps Javascript API V3 Places Library documentation.

You can also use the Geonames.org data dump and roll your own geo queries or use their REST API. Using their database you can search for various types of geographical entities (see feature codes).

Most modern SQL Server deployments have some geospatial support, usually using some flavour of the Haversine Formula to find results nearby should you wish to download the data dump.

However, if you just want to use their public REST API you will find that they already have a Find Nearby Toponym method, that takes a Feature Code and various other search parameters and returns XML or JSON.

That should enable you to search for heliports within 50 km of San Francisco should you so wish!

If you would like to see this in action, in combination with Google Maps, here is something I just threw together (you'll need you own Geonames account). In case of a zombie attack you should avoid the following cemeteries in San Francisco.




回答2:


'Google Geocoding API' this could help you to find the list of nearest locations by passing the address. for reference go to this link

http://code.google.com/apis/maps/documentation/geocoding/

You can use this API by passing the address. It can be also possible to find the list by passing the co-ordinates like latitude and longitude




回答3:


I think you might mean LocalSearch API which is deprecated - it's Places API now.



来源:https://stackoverflow.com/questions/5232242/google-api-get-nearest-locations

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