AI-generated Key Takeaways
-
The
duration
field provides estimated travel time influenced by thetraffic_model
setting. -
traffic_model
options includeBEST_GUESS
(default),PESSIMISTIC
, andOPTIMISTIC
, impacting travel time predictions. -
BEST_GUESS
considers historical and live traffic data for travel time estimation, with live traffic having more impact closer to departure. -
PESSIMISTIC
andOPTIMISTIC
offer durations longer and shorter than actual travel times on most days, respectively, accounting for traffic variations.
This field specifies one of the following assumptions to use when calculating travel time in traffic conditions, shown in the enums below. Depending on the enum chosen, the duration
field of the TrafficModel response will vary. The value contains the predicted time to destination in traffic, based on historical averages. TrafficModel
is only available for requests that have set
to RoutingPreference
TRAFFIC_AWARE_OPTIMAL
and
to RouteTravelMode
DRIVE
.
Enums | |
---|---|
TRAFFIC_MODEL_UNSPECIFIED |
Unused. If specified, will default to BEST_GUESS . |
BEST_GUESS |
Indicates that the returned duration should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the departureTime is to now. |
PESSIMISTIC |
Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value. |
OPTIMISTIC |
Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value. |