Map Matching in Azure Maps

Muhammad Abdul Moeed 61 Reputation points
2021-10-25T22:45:28.63+00:00

Is it possible to perform map matching on azure maps with tier S0 subscription? Currently, my point layer on the map doesn't have precise coordinates and is mapped a bit far away from the road, which in my case is false as the points' coordinates are coming from GPS installed on a moving vehicle on road. Hence, I would like the points to snap to road, without using an API. Is it possible to implement a functionality like that in Azure Maps? My main problem is that I am unable to compute the nearest distance of the point to an imaginary point on road. A help would be greatly appreciated. Thanks!

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

Accepted answer
  1. rbrundritt 18,076 Reputation points Microsoft Employee
    2021-10-26T17:27:13.297+00:00

    Yes, there are several ways to achieve this in Azure Maps.

    1. Pass a point into the reverse geocoding service. If the point is near a road, it will return a position that is on the road. https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address-reverse
    2. If you have a lot of points that is meant to form a path along a route, such as a GPS trace, then you can pass then as supporting points into the routing service. https://learn.microsoft.com/en-us/rest/api/maps/route/post-route-directions Here are a couple code samples:
      https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20drawn%20line%20to%20roads
      https://azuremapscodesamples.azurewebsites.net/?sample=Snap%20points%20to%20logical%20route%20path
    3. If you are working with individual points and are using one of the interactive map controls, you can do some math and snap to the closest road geometry in the vector tiles of the map. This is a very cheap solution (no additional cost if you are already loading the tiles for display purposes). Here is a sample:
      https://azuremapscodesamples.azurewebsites.net/?sample=Basic%20snap%20to%20road%20logic
    4. You can access the vector tiles directly and do similar math to above to create a cheap snapping solution. This is a decent amount of work to setup, but once done is really cheap.
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.