question

MuhammadAbdulMoeed-3914 avatar image
0 Votes"
MuhammadAbdulMoeed-3914 asked MuhammadAbdulMoeed-3914 commented

Map Matching in Azure Maps

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

rbrundritt avatar image
1 Vote"
rbrundritt answered MuhammadAbdulMoeed-3914 commented

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://docs.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://docs.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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The solutions mentioned in points 2 and 3, I have tried implementing but they require service modules(https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-services-module) and spatial IO modules(https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-spatial-io-module) correspondingly, which I think are not available in tier S0 subscription. Please correct me if I am wrong.

Also, point 1 and 4 are what I want to implement in my use case. But in point 4, I have trouble accessing vector tile and applying maths on it as it is a pbf file and the data inside it is something I am unable to make use of. Is there any alternative way to convert pbf into JSON/geoJSON and make computations such as HMM(Viterbi Algorithm) for Map matching in Azure Maps? Thanks!

0 Votes 0 ·