0

I am using HereMap Android Sdk.

I need to get the traffic delay for a route automatically. In Route class i have found 3 method for calculatine Tta:

Excluding Traffic:

getTtaExcludingTraffic(int subleg)

Gets the estimated time to arrival without considering traffic conditions.

Including Traffic:

getTtaIncludingTraffic(int subleg)

Gets the estimated time to arrival, taking into account traffic conditions at the time of the route calculation. Note, if the route was originally calculated without setting a traffic penalty mode or originally calculated with a traffic penalty mode other than OPTIMAL, this method will return the estimated time to arrival without considering traffic conditions.

Downloaded Traffic:

getTtaUsingDownloadedTraffic(int subleg)

Gets the estimated time to arrival with traffic conditions, where the traffic conditions are taken from traffic data downloaded to the device.

getTtaIncludingTraffic returns the RouteTta at the time of route calculation, which is not updated value. I can use getTtaUsingDownloadedTraffic but i have to manually request with TrafficUpdater class the retrieve the RouteTta.

Is the any way I can get the delay time for traffic automatically?

Here i have attached a screenshot from Here WeGo app. They show traffic delay time in Navigation screen which i have marked below.

Navigation

How can i get the traffic delay time automatically via a callback?

Any kind of help and suggestion is appreciated.

Community
  • 1
  • 1
Abu Yousuf
  • 5,729
  • 3
  • 31
  • 50

1 Answers1

0

You can try to get time duration using the following code snippet :

int timeInSeconds = route.getTtaExcludingTraffic(Route.WHOLE_ROUTE).getDuration();
  • This will give time to arrive without considering traffic. i have to call it manually. but i want to get the delay automatically like callback – Abu Yousuf Mar 26 '20 at 12:36