How to get the nearest cities within specific radius from given city using Bing API

2020-10-01T12:40:03.807+00:00

How to get the nearest cities within specific radius from given city using Bing API

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
{count} votes

Accepted answer
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2020-10-06T19:11:39.627+00:00

    On this topic, it would be good to understand your expectation of such a service. There are several ways to accomplish what is being asked here, but they have different levels of accuracy:

    1. Calculate the straight line distance from a point to the center point of every nearby city. This is fairly easy, but is completely dependent on the center point of the city. cross through the search area. Large cities may have large areas that overlap your search area, but the center point doesn't.
    2. Do an intersection test on city boundary data. This is much more expensive to accomplish, but much more accurate. However, there isn't well known boundary data available for all cities globally.
    3. Both of the above are based on straight line distance, but in most scenarios end users are more interested in travel time or distance. For that you can use the route range service in Azure Maps to generate an isochrone polygon which can then be used to do an intersection test on one of the two approaches above.

    If #1 is suitable for your scenario, or 1 + 3, you can get a list of city point locations for free from GeoNames: https://www.geonames.org/ (Lots of other sources out there too, but geonames has been around for ages and most other sites use this as a data source. Its also updated regularly).

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2020-10-01T18:27:36.39+00:00

    Neither Bing nor Azure Maps provides this functionality currently. However it is something being looked into as a potential future feature in Azure Maps.

    Also note that Bing Maps is a separate platform for Azure Maps, the Bing Maps forums here: https://social.msdn.microsoft.com/Forums/en-US/home?category=bingmaps

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.