查询 TrafficModeType 和出发时间

Query about TrafficModeType & departure time

在通过计算路由(routing)时API,注意到当"traffic"设置为"enabled"时,还必须提供"departure"参数:

https://developer.here.com/documentation/routing/topics/resource-param-type-routing-mode.html#type-traffic-mode

当流量设置为启用时,文档中突出显示了以下几点:

"No departure time provided: This behavior is deprecated and will return error in the future."

因此,当我现在需要计算从 A 点到 B 点的旅行时间(比如开车)并且启用交通时,我还需要提供值为 "now" 的 "departure" 参数?

是的,没错。如果要根据当前交通状况计算路线,则需要明确提供 departure=now。

出发 - 旅行预计开始的时间。计算路线时会考虑交通速度和事故(请注意,在过去的出发时间的情况下,历史交通仅限于一年)。您可以使用 now 来指定当前时间。指定出发或到达,而不是两者。输入:xs:dateTime.

示例:出发=2018-07-04T17:00:00+02

如果未指定可选时区偏移量,则假定时间为本地时间。