Why does Bing MAP API return wrong distance when using routeSummariesOnly?

Frederik Kjær Grote 0 Reputation points
2023-03-13T12:55:12.51+00:00

When I apply the routeAttributes=routeSummariesOnly, the result deviates drastically from the results I get otherwise.

When I look up

https://dev.virtualearth.net/REST/v1/Routes/driving?waypoint.1=55.8236488,12.4237305&waypoint.2=56.1979072,10.2593698&o=xml&culture=dk&key=KEY&optimize=distance&avoid=ferry&routeAttributes=routeSummariesOnly

https://dev.virtualearth.net/REST/v1/Routes/driving?waypoint.1=55.8236488,12.4237305&waypoint.2=56.1979072,10.2593698&o=xml&culture=dk&key=KEY&optimize=distance&avoid=ferry

(Key has been removed so the link does not work without a new key)

The first returns a distance of 169.047 km while the second returns (the correct) 331.026 km distance. The two are completely identical with routeSummariesOnly being the only difference.

Why does routeSummariesOnly return a different (and wrong) result?

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Faraz Siddiqui 90 Reputation points Microsoft Employee
    2023-04-06T22:04:59.8933333+00:00

    Dear Frederik Kjær Grote, thank you for reporting the issue with the routeSummariesOnly and I am sorry to hear that you are running into an issue with the travel cost. There is already a workaround provided in the comment thread of this post to use routeAttributes as "all" or default. You can also use "routepath" as an alternative. When requesting "routeSummariesOnly" which is a low latency algorithm to return the travel cost, it is not honoring the avoid ferry route preference in combination with the optimize distance. The travel distance and time you are getting back is for the driving+ferry route and not the straight-line distance between the start and end location. The default route attribute honors the avoid ferry and returns the travel cost for the driving only route, so you see the difference in the travel distance and time. We have added this defect to our backlog and will address it. Faraz

    1 person found this answer helpful.
    0 comments No comments

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.