Duration_in_traffic is less than duration in the Google Distance Matrix API

I use the function "duration_in_traffic" and "duration" using the DistanceMatrix API.

For a given pair of coordinates, I see the following results:

{
  "destination_addresses": [
    "Hamburg, Germany"
  ],
  "origin_addresses": [
    "85748 Garching, Germany"
  ],
  "rows": [
    {
      "elements": [
        {
          "distance": {
            "text": "761 km",
            "value": 760831
          },
          "duration": {
            "text": "7 hours 1 min",
            "value": 25242
          },
          "duration_in_traffic": {
            "text": "6 hours 42 mins",
            "value": 24145
          },
          "status": "OK"
        }
      ]
    }
  ],
  "status": "OK"
}

Here is my question:

How is it that duration_in_traffic is less than duration?

From what I understood:

Duration: The duration of the journey along the route ... Not sure if it is without traffic

Duration_in_traffic: Duration of the trip along the route in traffic conditions.

Any explanation in this regard would be greatly appreciated.

+4
source share
1 answer

. durationInTraffic . Google Maps API for Work , . driveOptions .

, -, / , duration_in_traffic ( ). , 7 1 , 6 42 .

, Google , , 60 / - , 23:00, 120 /.

traffic_model: best_guess, , duration_in_traffic.

+5

Source: https://habr.com/ru/post/1650746/


All Articles