Find nearest road to a latitude and longitude point

Hessar, Robert 1 Reputation point
2021-11-16T22:01:49.593+00:00

Hi,

given a Lat/Lon I am trying to detect if there are any road surfaces within 100 meter surrounds of that Lat/Lon, or even if the point
itself is on a road.

I tried nearest cross street service not quite the result needed , also the POI search doesn't seem to have a POI=road.

if there anyway to find if there is a road is within 100m of a given Lat/Lon in Azure services?

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

3 answers

Sort by: Most helpful
  1. IoTGirl 3,126 Reputation points Microsoft Employee
    2021-11-16T23:54:54.4+00:00

    Hi Robert,

    That is correct "POI" or Point of Interest is not a road. Likely you will want to reverse geocode that Lat/long and see what you get back for a location. You can try both reverse address & reverse cross street search and see if they work for you. https://learn.microsoft.com/en-us/azure/azure-maps/how-to-search-for-address

    Sincerely,
    IoTGirl

    0 comments No comments

  2. Hessar, Robert 1 Reputation point
    2021-11-23T09:02:33.13+00:00

    Hi I managed to get map section downloaded using the static map API

    api_url=f"https://atlas.microsoft.com/map/static/png?api-version=1.0&style=main&layer=basic&zoom=18&height=800&Width=800&center=151.902009,-27.854467&path=lcFF0000|lw2|la0.10|ra100||151.902009 -27.854467&subscription-key={subscription_key}"
    response = requests.get(api_url)

    image = imageio.imread(response.content)
    151719-image.png

    now I need to work out how to
    a) disable the labels so don't get street names and numbers
    b) if I can get a different tile that shows building boxes as well

    0 comments No comments

  3. rbrundritt 18,076 Reputation points Microsoft Employee
    2021-11-23T18:27:42.183+00:00

    The reverse geocoding service (search address reverse) uses a 150m radius I believe. If you want to filter more, you can calculate the distance from your point to the point returned by the service using the haversine formula

    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.