none
Bing Maps REST API result is different than Bing maps web UI RRS feed

  • Question

  • Hi,

    Recently we upgraded integration with Bing maps from SOAP service to REST APIs in one of our application. REST API has been used to calculate the distance between two address locations. Based on output (distance in km) payment is being calculated. Recently we came across few incidents where distance calculated using REST API is different (less) than distance calculated from Bing maps web UI.

    This difference is impacting the application now. What is the reason for this variation in result? Is there any way to showcase  result of Bing REST API is correct.

    Thanks,

    Pankaj

    Wednesday, September 13, 2017 6:42 AM

Answers

  • Ok, the reason for the difference is that the Bing Maps website only calculates routes based on time with traffic, while you are optimizing the route for shortest distance. If you change the route optimization to TimeWithTraffic, you should get similar results, although they may be slightly different if the requests aren't made at the same instance since it is using real time traffic data.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, September 13, 2017 4:34 PM
    • Marked as answer by Pankaj mohite Thursday, September 14, 2017 1:26 AM
    Wednesday, September 13, 2017 4:34 PM

All replies

  • Can you provide examples?

    [Blog] [twitter] [LinkedIn]

    Wednesday, September 13, 2017 6:44 AM
  • Ok, let's step back a second. What are you doing? Calculating a route and comparing the calculated distances? Geocoding results and comparing their results?

    [Blog] [twitter] [LinkedIn]

    Wednesday, September 13, 2017 7:13 AM
  • First we are using location service to get co-ordinates for address. Then we are using these co-ordinates to calculate distance between two points.

    Following are the route options used to make a route request.

                    .Optimize = RouteOptimizationType.Distance, _
                    .DistanceUnits = DistanceUnitType.KM, _
                    .TravelMode = TravelModeType.Driving

    I have validated the distance using co-ordinates and physical address from bing maps web UI but still it shows difference in the result when compared with REST.

    Regards,

    Pankaj Mohite

    Wednesday, September 13, 2017 7:39 AM
  • Ok, the reason for the difference is that the Bing Maps website only calculates routes based on time with traffic, while you are optimizing the route for shortest distance. If you change the route optimization to TimeWithTraffic, you should get similar results, although they may be slightly different if the requests aren't made at the same instance since it is using real time traffic data.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, September 13, 2017 4:34 PM
    • Marked as answer by Pankaj mohite Thursday, September 14, 2017 1:26 AM
    Wednesday, September 13, 2017 4:34 PM
  • Thanks for the response. When we change route optimization to Time we are getting same result as Bing maps website. Could you please let us know which optimization is recommended to get standard result instead of real time.
    Thursday, September 14, 2017 1:26 AM
  • If you don't want to take traffic into consideration, then just use Time as the optimization. Note that you can set a future date time to calculate a route for and it will use predictive traffic data in case that is more inline with what you are looking for.

    [Blog] [twitter] [LinkedIn]

    Thursday, September 14, 2017 2:53 AM