none
Bing Maps Distance Matrix API result not accurate RRS feed

  • Question

  • Hi

    I am using the Bing Maps Distance Matrix API. I am trying to calculate the distance between individual coordinates on a route. The problem is that the Distance Matrix API returns different values compared to the actual value as per the Bing Maps website.

    For example, I have two coordinates on a straight road which should be 100m apart:

    origin: -34.00207,25.670521

    Destination: -34.00207,25.671997

    The Distance Matrix API result between the above coordinates is 0.442km (or 422m):

    The Bing Maps website has the correct distance of 0.1km (100m):

    I am not sure what to do here as I need it to calculate energy consumption for an EV for each segment. However, if the distances are inaccurate by a few hundred meters it makes a significant difference over the entire route. Any ideas how to overcome this issue?

    Sincerely,

    Martin Smuts  






    • Edited by Martin Smuts Thursday, September 20, 2018 1:13 PM
    Thursday, September 20, 2018 1:06 PM

Answers

  • Hi,

    Thanks for mentioning the Snap to Road API. I will check if this helps.

    I have also noticed that the Routes API returns two sets of coordinates. There is a list for the route (RouteLegs/maneuverPoint), which provide point-to-point segments.

    Another list is a more detailed route (RoutePath), which include the main segments' geo-coordinates and some fractured segments the main segments.

    When the I apply the Distance Matrix to the RouteLegs points the results are fairly accurate.

    Kind Regards

    Martin










    • Marked as answer by Martin Smuts Wednesday, September 26, 2018 12:59 PM
    • Edited by Martin Smuts Wednesday, September 26, 2018 1:05 PM
    Wednesday, September 26, 2018 12:56 PM

All replies

  • Hi Martin,

    I have asked the Bing Maps Team to take a look at your results and will let you know what they come back with.

    Update:  Can you try a complete segment rather than a part segment and see if that changes the behavior?

    Full Segment Geometry

    Sincerely,

    IoTGirl


    Thursday, September 20, 2018 3:49 PM
    Owner
  • Hi there,

    Thank you for the quick reply and sending my request to the team. I have attempted the full segment as you suggested. The result is more accurate than a part of a segment. However, this does not solve my problem.

    The coordinates for a route are retrieved from the Bing  Routes API when I enter a destination in my app, which means I do not know the list of coordinates on the route ahead of time. Hence, I do not know if a particular coordinate is within a segment, or at the start/end of a segment. My app sends the list of coordinates directly to the Distance Matrix API to calculate the distance between each set of coordinates. I cannot verify each coordinate whether they are at the start and end of a segment.

     



    • Edited by Martin Smuts Friday, September 21, 2018 12:07 PM
    Friday, September 21, 2018 12:06 PM
  • Hi Martin,

    Do you have a sample routing call that gives you fractured segments?  Our assumption would be that routing would return proper point to point segments and not a segment as you have shown.  If you are actually pulling back geo-co-ordinates and not a route, the Snap to Road API could be used to clean up those co-ordinates into a proper route.  https://www.microsoft.com/en-us/maps/snap-to-road

    Sincerely,

    IoTGirl

    Friday, September 21, 2018 4:05 PM
    Owner
  • Hi,

    Thanks for mentioning the Snap to Road API. I will check if this helps.

    I have also noticed that the Routes API returns two sets of coordinates. There is a list for the route (RouteLegs/maneuverPoint), which provide point-to-point segments.

    Another list is a more detailed route (RoutePath), which include the main segments' geo-coordinates and some fractured segments the main segments.

    When the I apply the Distance Matrix to the RouteLegs points the results are fairly accurate.

    Kind Regards

    Martin










    • Marked as answer by Martin Smuts Wednesday, September 26, 2018 12:59 PM
    • Edited by Martin Smuts Wednesday, September 26, 2018 1:05 PM
    Wednesday, September 26, 2018 12:56 PM
  • Hi Martin,

    Thank you for confirming that the other segment type works for you!

    Sincerely,

    IoTGirl

    Sunday, September 30, 2018 11:43 PM
    Owner
  • Were you able to get this issue fixed? I am exactly facing the same problem which is so frustrating. For example, 

    Here are two points for which the travel times on Bing Maps browser and our API results are significantly different. (This is just an example, almost all our results have higher travel time durations than the Map browswer results) 

    1 32.64018504 -96.98876074
    2 32.70109426 -96.59636179

    Browser API travel time duration on 9 AM on Aug 21 = 45 mins 
    API Travel Time for the same time = 82 mins

    Thursday, August 8, 2019 10:19 PM