首页 > 解决方案 > 有没有办法直接在 HERE 流量结果中获取永久链接 ID?

问题描述

我想使用交通流量数据来增强具有交通信息(如拥堵因素)的路线。

推荐的方式似乎是获取一条路线,为路线的所有功能类和区域下载 TMC 瓦片,并将路线链接与交通流量数据中的 TMC 代码匹配,例如参见如何使用 HERE 地图开发自定义路由算法?.

但是,交通流文档(TrafficML_RealTime_Specification_v3.2.2.docx)在 Flow Item Description 中提到了一个标签“SHP/LID”来包含链接 id,这可以简化整个过程:

SHP/LID:
LinkID associated with the SHP reference. The linkID will be in
driving direction order; “F” represents travel direction FROM
reference node, “T” represents travel direction TO reference
node (For example, 123456789T or 987654321F).

在我的 API 调用中,我明确请求形状 (responseattributes=sh) 并接收它们,但没有给出“LID”字段。

https://traffic.api.here.com/traffic/6.2/flow.json?corridor=52.5396895,12.9778897;52.5394964,12.9782331;52.5390244,12.9769778;52.539078,12.976774;52.5392067,12.9762483;52.5395072,12.9750788;52.5396144,12.974714; 52.5397754,12.974124;52.5400114,12.9732764;52.5405693,12.9723108;52.5409126,12.9719353;52.5415349,12.97068;52.5416744,12.9694784;52.5404727,12.9654121;52.5387347,12.9640496;52.5384343,12.9646397;52.5380695,12.9651332;52.5379193,12.965219;52.5370181,12.9656482;52.5359452, 12.9659379;52.5349581,12.9661417;52.5339067,12.9663348;1000&responseattributes=sh,fc&app_id=xxx&app_code=yyy

{
  "RWS": [
    {
      "RW": [
        {
          "FIS": [
            {
              "FI": [
                {
                  "TMC": {
                    "PC": 10213,
                    "DE": "Berlin-Spandau",
                    "QD": "+",
                    "LE": 4.18578
                  },
                  "SHP": [
                    {
                      "value": [
                        "52.55838,12.96583 52.55761,12.96545 52.55705,12.9652 52.55641,12.96494 52.55588,12.96473 52.55577,12.96468 "
                      ],
                      "FC": 1
                    },
                    {
                      "value": [
                        "52.55577,12.96468 52.55566,12.96464 "
                      ],
                      "FC": 1
                    },
...
                    {
                      "value": [
                        "52.55935,12.96635 52.55838,12.96583 "
                      ],
                      "FC": 1
                    }
                  ],
                  "CF": [
                    {
                      "TY": "TR",
                      "SP": 120,
                      "SU": 121.78,
                      "FF": 105,
                      "JF": 0,
                      "CN": 0.99
                    }
                  ]
                },

有没有办法接收带有流数据的永久 ID?

标签: here-api

解决方案


有一个类似的问题和解决方案。

请看下面。

为什么交通数据中的 TMC 与 PDE 层 LINK_TMC_FC 中的 TMC 不匹配?


推荐阅读