Bing API for finding nearby cities
Is there a Bing API for finding nearby cities given a city name or lat/long combination?开发者_如何学Python
I don't know if Bing provides this, but you build your own from the data available from geonames.org
They provide an API to get places near a given lat/lng: http://api.geonames.org/findNearby?lat=47.3&lng=9&username=demo
Or you can also go all out and implement a solution for your own needs using their data, as per this answer: Given the lat/long coordinates, how can we find out the city/country?
I think this is what you're looking for: Bing Maps API Sample
The short answer is no, there is no Bing API for finding nearby cities.
That said, it would be possible to 'cook your own' using the existing APIs. However, one thing that would need clarification is what 'nearby' means. I presume you mean within a specific radius of a given point (determined by a city name or lat/long combination).
Using the Bing Api it would be fairly trivial to implement an algorithm to reverse geocode a location and then test for places within x distance.
Failing that, you could use something like geoPlugin, it is free and you can put it on your sever - thus avoiding 3rd party up-time issues. http://www.geoplugin.com/webservices/php#php_class
Take a look at the nearby places features, this does exactly what you want. http://www.geoplugin.com/webservices/extras
No, there isn't. However, it's relatively simple to get the bounding box for a given coordinate and then use the Bing Maps API with that. I'm doing this and used this solution to get what I needed...
https://stackoverflow.com/a/14314146/73680
精彩评论