locked
Get a list of street names and numbers contained in a polygon RRS feed

  • Question

  • I'd need to define a polygon and then get a list of all street names/numbers in that polygon. I've looked into the API but cannot find anything to do this. Is this possibile?

    I also looked into Azure Maps, I'm not sure if it is a different product or just a rename of Bing Maps, in any case, can't find anything there either.

    • Moved by Ricky_Brundritt Wednesday, May 16, 2018 3:46 PM Azure Maps question
    Wednesday, May 16, 2018 7:43 AM

Answers

  • I'm not aware of any global mapping platform that provides this functionality as a service. However there are a few ways to achieve this.

    Approach 1:

    If you only need this to work in a small area such as a single state or city, take a look around for the local GIS departments website. Sometimes they will have road data available in an ESRI Shapefile. You can then take this data, upload it into SQL server and easily retrieve all roads that intersect with the polygon. This would be the most accurate approach, but is limited in where you could do this and also requires the most work.

    Approach 2:

    For this approach, calculate a bounding box for your polygon (min/max latitude/longitude), then break it up into a grid. A grid spacing of 0.0005 degrees would be fairly accurate and represents a distance of about 55 meters or less. For each point in the grid, check to see if it is in the polygon, if it is, then make a reverse geocode call to retrieve the road information. The reverse geocoder will return a point that is likely snapped to the nearest road, use the returned coordinate and verify it is inside the polygon. If it is, then the road is in the polygon. Do this for all points in the grid.  This approach will be a bit less accurate and will generate more costs long term, but fairly easy to implement. I have a very old blog post on doing something nearly identical using Silverlight here: https://rbrundritt.wordpress.com/2010/01/09/reverse-geocoding-over-a-search-area/ 

    Azure Maps is a completely separate product from Bing Maps. They do have a lot of similarities currently as all mapping platforms need a common set of foundation services. Here are some resources for Azure Maps:


    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, May 16, 2018 3:43 PM
    • Marked as answer by pmonte Wednesday, May 16, 2018 3:47 PM
    Wednesday, May 16, 2018 3:43 PM

All replies

  • I'm not aware of any global mapping platform that provides this functionality as a service. However there are a few ways to achieve this.

    Approach 1:

    If you only need this to work in a small area such as a single state or city, take a look around for the local GIS departments website. Sometimes they will have road data available in an ESRI Shapefile. You can then take this data, upload it into SQL server and easily retrieve all roads that intersect with the polygon. This would be the most accurate approach, but is limited in where you could do this and also requires the most work.

    Approach 2:

    For this approach, calculate a bounding box for your polygon (min/max latitude/longitude), then break it up into a grid. A grid spacing of 0.0005 degrees would be fairly accurate and represents a distance of about 55 meters or less. For each point in the grid, check to see if it is in the polygon, if it is, then make a reverse geocode call to retrieve the road information. The reverse geocoder will return a point that is likely snapped to the nearest road, use the returned coordinate and verify it is inside the polygon. If it is, then the road is in the polygon. Do this for all points in the grid.  This approach will be a bit less accurate and will generate more costs long term, but fairly easy to implement. I have a very old blog post on doing something nearly identical using Silverlight here: https://rbrundritt.wordpress.com/2010/01/09/reverse-geocoding-over-a-search-area/ 

    Azure Maps is a completely separate product from Bing Maps. They do have a lot of similarities currently as all mapping platforms need a common set of foundation services. Here are some resources for Azure Maps:


    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, May 16, 2018 3:43 PM
    • Marked as answer by pmonte Wednesday, May 16, 2018 3:47 PM
    Wednesday, May 16, 2018 3:43 PM
  • Thanks a lot. I suppose neither Azure Maps offers such a possibility, right?

    We'll look into the possibility to buy data from Here, TomTom or ESRI as we'd need them at least nationwide. Can you say if these are the right companies to ask for such data?

    Wednesday, May 16, 2018 3:49 PM