Question about route calculation


I came up with another question while performing some tests with route calculation.

Here’s my issue.

The route calculation works great when the distance between departure point and arrival point are not very far. More clearly, I am using the USA map for testing, and route calculation within a state works great (within the ranges of 2-3 states are fine too).

The problem occurs when I try to run a route calculation for a very long distance. More specifically, when I try to run a route calculation between Los Angeles and New York (requesting 3-4 possible routes), the query takes very long time, and often it fails too.

Below is the error message I am getting when the long distance route calculation fails:

E/OnlineRoutingApi: Planning route failed: Query: calculateRoute/47.90025,-122.20745:39.558277,-80.52816/json?&maxAlternatives=3&language=en-GB&computeBestOrder=false&routeRepresentation=polyline&computeTravelTimeFor=none&sectionType=travelMode&routeType=shortest&traffic=false&travelMode=car
Err:{“formatVersion”:“0.0.12”,“error”:{“description”:“Engine error while executing route request: STOPPED”}}

Is there anything I am missing? Is there a way to make the query more efficient, reliable, and faster? Any advice would be appreciated.

Calculating shortest one for a very long route is a very resource consuming combo. Is there a reason that you want to calculate a shortest way?

1 Like

Oh, okay. Yes it makes sense. I am requesting calculation for the shortest path.

How about the other options?

I believe there are 3 more options - fastest, eco, thrilling.

Do they consume resources as much as the shortest?

My calculation method doesn’t have to be the shortest way. Any other reasonable routes would work too.

The most popular option is the fastest, so the service is optimized to calculate the fastest way.
Thrilling - popular case for motorcycles. This one also need a lot of resources, but people usually don’t want to spend 8h driving the most curvy road :slight_smile:

I see. Thank you for the clarification. I’ll try with the fastest option.