Which route does Gmaps choose when using Distance Matrix API

22 Views Asked by At

I am running a small project to use google maps API in Python to calculate the distance between 2 points, let's call it A and B.

When I key in the start(A) and end(B) points respectively, mode of transport = driving, they will give me an output of the distance and time.

I've compared the results to googlemaps, while it was accurate for both the time to reach and the distance (listed as one of the options), at times, the result given was not of the shortest distance or the shortest time.

Anyone knows why this is happening and if there was anyway that i could force the API to give me the routes with either the shortest time or route.

**For clarity: google maps does provide several options for driving, just want to know how the decision making is done to optimize the result

Thanks for your help in advance!

0

There are 0 best solutions below