snap-to-road RRS feed

  • Question

  • Hi,

    I really need to know how can I integrate Bing maps with distance matrix and snap points to road .

    Please help
    Thursday, August 8, 2019 9:16 AM


All replies

  • Hi Abhi070990,

    Guidance as to the purpose of these API's can be found at https://www.microsoft.com/en-us/maps/fleet-management

    Distance Matrix helps you decide which routes to take while Snap to Road you would use after receiving a list of GPS co-ordinates and discovering which route was taken.



    Thursday, August 8, 2019 3:59 PM
  • Ok, understood. but as I am new with bing maps, so can you please explain or give an example that how can I use the response given by distance matrix for implementing snap to Road with map?

    Saturday, August 10, 2019 4:14 AM
  • Hi Abhi70990,

    You would not use the results from Distance Matrix with Snap to Road as Distance Matrix already provides routes that are on roads.  Let me give you a typical scenario:

    A delivery company wants to optimize their routes and confirm that their drivers visited the locations they were expected to on their shift.  The dispatcher uses Distance Matrix to plan the best routes for the drivers to take on their shifts.  Drivers are tracked using a geotracking device and points are collected as they do their routes.  The points are collected are passed to Snap to road to give the route that they most likely took during their shift.  The dispatcher can then confirm that the driver visited all expected delivery points.

    To sum up, Distance Matrix is used before the route is driven and Snap to Road is used afterwards.



    Saturday, August 10, 2019 6:43 PM
  • Ok, that makes everything clear as of now. Just one question that I want to ask. I want to show bing map at my website having the shortest path between them. I used Distance matrix api and got the result.
    But how can I use that json Response to show the Map. I am really concern about this.

    Let's say I used following Distance matrix API

    and I got the response in json format. Now my question is, how can I use the response to show the shortest path between the two points in bing map or it is not like that? Or it is for just to get the distance and travel time?  Sorry, if the question is silly.

    Actually I want to show the shortest path between  two location in map. Please help

    • Edited by Abhi070990 Monday, August 12, 2019 10:35 AM
    Monday, August 12, 2019 10:25 AM
  • Hi Abhi070990,

    You don't need distance matrix to show the shortest path, just use the routing API.  Try the following code https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk/directionscreatedrivingroute and look at the menu on the left to find other examples of how you might use Bing Maps.



    Monday, August 12, 2019 3:46 PM
  • Thanks a lot, this is what I was looking for..
    Tuesday, August 13, 2019 3:59 AM
  • You are very welcome!
    • Marked as answer by Abhi070990 Tuesday, August 13, 2019 9:13 AM
    Tuesday, August 13, 2019 4:26 AM
  • Hi,

    I am finding that the route is not optimized. At various position according to the route the Driver have to stop and takes the u turn where not even required.
    Is there any way to get the optimized route? Or does bing takes the map on its own?

    Friday, August 16, 2019 7:24 AM
  • Hi Abhi070990,

    If you wish the route to go a specific way, you can add waypoints to force the route to pass through that location.  The route you expect may not be chosen due to many reasons, such as historical traffic or local projects etc.



    Friday, August 16, 2019 8:58 PM
  • Hello,

    The issue which I am facing is as follows.

    Lets say there are 5 address where the Driver need to parcel the package and he starts from Address A.

    Now we have latitude and longitude of all the address, but the route defines according to our address. Lets say that I have a sequence of addresses as Address B, Address C, Address D, Address E and so on. But Address C is closest to the starting points than Address D and so on. Now how and by which API I can manage the order of multiple addresses so that the Driver don't have to travel a lot unnecessary.

    I home it makes everything clear. The route should be defined in such a way that the nearest address should be cover first.

    Thursday, August 29, 2019 9:43 AM
  • Thursday, August 29, 2019 4:01 PM