Calculate current traffic delay with Routing API and Where is extensive documentation

I am trying to find what setting withConsiderTraffic to true or false does. I noticed the travel time doesnt change, its both live travel time. In the short website documentation it seems like when it is set to true, it considers finding an alternative route. But does it matter what I set it to, if I do not specify a route but only departure and arrival coordinates?

More specifically what I am trying to do is get the ammount of current delay caused by traffic jams. Appeartenly withConsiderTraffic does not mean: calculate route with or without current live traffic. Another way I figured is setting departure time far in the future, like 12 hours ahead as traffic will always be solved by then, but now I dont know if there is some kind of learning algorithm in the TomTom API’s: for example if that 12 hours ahead lands on 9 o’clock on monday morning, does the routeQuery return a longer travel time as it is usually busy at that time?

I read everything on the https://developer.tomtom.com/maps-android-sdk/online-route-planner-examples page offcourse but couldn’t find an answere
In Android Studio in the RouteQueryBuilder.class or in the RouteResponse.class I tried to click Download sources. It sais it is ‘Downloading sources…’ for a couple of minutes and later ‘Attaching…’, but after a while it jumps back to ‘Decompiled .class file, bytecoder version: 52.0 (Java 8)’.
Is there any extensive documentation about the methods and its arguments about the Routing API on this website?

Hi BobIndustries.

Welcome to our community!

According to the Routing API documentation, when traffic parameter is set to false, the routing engine will still take into consideration historical traffic.
There is a tutorial application called Time to Leave. The source code is on GitHub. Application is periodically checking traffic conditions and travel time between two points so it might be helpful for you.
To receive more details about traffic conditions, you might also check the Incident Details API together with Flow Segment Data API. If you will mix it with Routing API response, you can get a quite detailed view on traffic conditions along your route.

I hope that helps a little bit.

Regards,
Mateusz

1 Like