首页 > 解决方案 > 在 PDE(平台数据扩展)中找不到来自路由的 HERE LinkId

问题描述

更新:它再次发生,也与 Fleet API 一起发生。请参阅文章末尾的其他示例。

我正在使用 HERE 的 REST API 来计算路线,然后通过查询 HERE 的平台数据扩展 (PDE) 来请求每个链接/路线段的附加数据。这通常可以正常工作,但现在我遇到了 PDE 无法识别的链接 ID。

这些服务不同步,还是我做错了什么?

在过去的几周里我没有遇到任何问题,而且对于大多数链接 ID 来说仍然可以正常工作,所以这可能是一个新问题,也可能是一个非常单一的问题。我在 HERE API 文档和 Stackoverflow 上进行了搜索,但找不到任何相关内容。

路线请求(A24 Berlin 往汉堡):https ://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.7091,13.0356&waypoint1=geo!52.7193,12.9608&mode=fastest;car;traffic :disabled&representation=navigation&app_id=xxx&app_code=yyy

json 响应(如下)包含一个永久 ID为 1199057935的链接,位于 Anschlussstelle Kremmen。

PDE 请求给出一个空响应:https ://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxx&app_code=yyy

{"Layers":[]}

相反,我希望包含瓦片的数据,例如我得到的 119905793 6

{"Layers":[{"layer":"ROAD_GEOM_FC1","level":9,"tileXYs":[{"x":548,"y":405}]}]}

我还尝试了使用 ROAD_GEOM_FC1 的 PDE 请求,并在 id 前面加上 + (values=+1199057935)。路线的其他链接 id 返回预期的瓦片信息。

为了完整起见,这是来自路由响应的链接 json:

{
 "linkId":"+1199057935",
 "shape":["52.7175629,12.976613","52.7177131,12.9749393"],
 "firstPoint":28,
 "lastPoint":29,
 "length":114,
 "remainDistance":1095,
 "remainTime":39,
 "nextLink":"+1199057936",
 "maneuver":"M2",
 "speedLimit":33.3333359,
 "dynamicSpeedInfo":{"trafficSpeed":16.3888893,"trafficTime":7,"baseSpeed":27.5,"baseTime":4,"jamFactor":5.7118645},
 "flags":["motorway"],
 "functionalClass":1,
 "roadNumber":"A24",
 "timezone":"+0100",
 "roadName":"",
 "consumption":0,
 "_type":"PrivateTransportLinkType"
}

更新 2019-05-27:

我从https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest;car;得到一条包含链接 id 1239826684 的路线流量:禁用&representation=navigation&app_id=xxx&app_code=yyy

使用队列端点重定向到与上述相同的呼叫,包括链接 ID 1239826684:https ://fleet.api.here.com/2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest ;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy

PDE 为该链接 ID 返回 []:https ://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy

Fleet API 为该链接 id 返回 []:http: //fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn &attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy

似乎底层地理数据不同步,使用不同的 API 也无济于事。还有其他解决方案吗?

标签: here-api

解决方案


您可以通过基本路由和 PDE 尝试 Fleet Telematics 组的 API,因为 Fleet Telematics 提供了整个路由解决方案。

请找到下面的 API 请求,它给出了 id-1199057935 的预期响应

http://fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxxx&app_code=yyyy

响应:{图层:[{图层:“ROAD_GEOM_FC1”,级别:9,tileXYs:[{x:548,y:405}]}]}

有关更多信息,请阅读以下文档

https://developer.here.com/documentation/fleet-telematics/api-reference.html#operation%2FindexJSONUsingGET

希望这会有所帮助。


推荐阅读