简体   繁体   English

Duration_in_traffic小于google Distance Matrix API中的持续时间

[英]Duration_in_traffic less than duration in google Distance Matrix API

I am using both the "duration_in_traffic" and "duration" feature using the DistanceMatrix API. 我使用DistanceMatrix API同时使用“duration_in_traffic”和“duration”功能。

For a given coordinate pair, 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 the duration_in_traffic is less than duration? 如何持续时间_in_traffic小于持续时间?

From what i understood: 据我所知:

Duration: Duration of travel on a route... Not sure if it is without traffic 持续时间:路线上的旅行持续时间......不确定是否没有交通

Duration_in_traffic: Duration of travel on a route under traffic conditions. Duration_in_traffic:交通条件下路线的行程持续时间。

Any explanation on this will be greatly appreciated. 对此的任何解释将不胜感激。

Note: The durationInTraffic field is now deprecated. 注意:durationInTraffic字段现已弃用。 It was previously the recommended way for Google Maps API for Work customers to specify whether the result should include a duration that takes into account current traffic conditions. 之前推荐的方法是Google Maps API for Work客户指定结果是否应包含考虑当前流量条件的持续时间。 You should now use the drivingOptions field instead. 您现在应该使用drivingOptions字段。

Duration seems to take an average of durations at different times/from historic data, while duration_in_traffic takes the given departure time (and live traffic) into account. 持续时间似乎取不同时间/历史数据的持续时间的平均值,而duration_in_traffic则考虑给定的出发时间(和实时流量)。 So the route takes 7 hours 1 min in average, but with your given time it only takes you 6 hours 42 mins from Hamburg to Garching. 所以这条路线平均需要7小时1分钟 ,但是在你给定的时间内,从汉堡到加兴只需要6小时42分钟

I don't know if Google has that detailed data, but it could be that during the day a part of the highway is most of the times limited to 60 km/h because of dense traffic, while your travel time is around 23:00 and due to that you are allowed to drive 120 km/h. 我不知道谷歌是否有详细的数据,但可能是白天高速公路的一部分大部分时间限制在60公里/小时,因为交通密集,而你的旅行时间大约是23:00因此你被允许以120公里/小时的速度行驶。

There are also the three values for traffic_model : best_guess, pessimistic and optimistic which can influence the duration_in_traffic value. traffic_model还有三个值:best_guess,悲观和乐观,它们可以影响duration_in_traffic值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM