0

当我在 Postman 中将此请求发布到 Azure Maps Routing (Key Removed)

https://atlas.microsoft.com/route/directions/json?subscription-key=xxx&api-version=1.0&query=50.7950853432162,-1.1176335811615:50.8494396228343,-1.06779478490353&departAt=2019-01-31T07:30:00&travelMode=car&&traffic=true

我收到了这个回复(只是发布的摘要)。

    "routes": [
    {
        "summary": {
            "lengthInMeters": 19388,
            "travelTimeInSeconds": 2146,
            "trafficDelayInSeconds": 0,
            "departureTime": "2019-01-31T07:30:00Z",
            "arrivalTime": "2019-01-31T08:05:46Z"
        },

我知道在这条特定路线上应该有大约 30 分钟的交通延误。为什么没有交通延误?

4

1 回答 1

1

TrafficDelayInSeconds 返回由实时事件引起的延迟(秒)。延迟以秒为单位与根据实时交通信息的条件进行比较。travelTimeInSeconds 值已经包括由于交通造成的延迟,通过使用与时间相关的历史交通数据计算得出。如果您在请求中添加参数“computeTravelTimeFor=all”,则响应将包括所有类型交通信息的行程时间,并在路由响应摘要中包含的 noTrafficTravelTimeInSeconds、historyTrafficTravelTimeInSeconds 和 liveTrafficIncidents 字段中指定所有结果。

在下面的示例中,travelTimeInSeconds 等于historyTrafficTravelTimeInSeconds,并且 trafficDelayInSeconds 是使用与时间相关的历史流量数据计算的。

 

"summary": {
                "lengthInMeters": 8446,
                "travelTimeInSeconds": 728,
                "trafficDelayInSeconds": 0,
                "departureTime": "2019-01-02T19:06:15Z",
                "arrivalTime": "2019-01-02T19:18:22Z",
                "noTrafficTravelTimeInSeconds": 606,
                "historicTrafficTravelTimeInSeconds": 728,
                "liveTrafficIncidentsTravelTimeInSeconds": 728
}

这是一个返回 trafficDelaysInSeconds >0 的实时路由请求响应:

{
            "summary": {
                "lengthInMeters": 2131,
                "travelTimeInSeconds": 274,
                "trafficDelayInSeconds": 37,
                "departureTime": "2019-01-02T20:00:37Z",
                "arrivalTime": "2019-01-02T20:05:11Z",
                "noTrafficTravelTimeInSeconds": 204,
                "historicTrafficTravelTimeInSeconds": 238,
                "liveTrafficIncidentsTravelTimeInSeconds": 274
            },

于 2019-01-08T01:27:31.887 回答