Azure Maps Routing不提供流量延迟信息

时间:2018-12-31 12:04:23

标签: azure-maps

当我在邮递员中将此请求发布到Azure地图路由(已删除键)

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分钟的交通延迟。为什么没有流量延迟?

1 个答案:

答案 0 :(得分:1)

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

在下面的示例中,travelTimeInSeconds等于HistoricTrafficTravelTimeInSeconds,并且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
            },