ApplicationError:请求中指定的LinkId不可用

时间:2018-09-28 15:42:13

标签: here-api

我正在使用HERE Route Match Extension API将GPX数据匹配到路由。之后,我将使用匹配路线中的道路链接来查询Routing API。几周前,这种方法非常有效。奇怪的是,我现在从Route Match Extension API(来自Routing API的响应)中得到了一些道路链接的错误:

"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "LinkIdNotFound",
"details": "LinkId(s) specified in request are not available",
"additionalData": [
    {
    "key": "LinkId[0]",
    "value": "-1224766809"
    }
]

在Route Match Extension API的响应中,道路链接肯定存在:

{“ confidenceValue”:0.6,“ elevation”:188.39999999999998,“ headingDegreeNorthClockwise”:10000.0,“ headingMatched”:118.0,“ lat”:49.67599245719612,“ latMatched”:49.67605,“ linkIdMatched”: -1224766809 ,“ lon”:10.035531716421247,“ lonMatched”:10.03558,“ matchDistance”:8.36,“ matchOffsetOnLink”:0.6588415883643146,“ minError”:1000000.0,“ routeLinkSeqNrMatched”:178,“ speedMps”:0.0,“ timestamp“:1532677148000}

以下是上述错误的示例查询链接:https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=link!-1224766809&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary

这是怎么回事?既然它在几周前就可以使用了,这只是暂时的问题吗?

在此先感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

RME和路由api的基础映射版本可能有所不同,这会导致两者的链接ID不匹配。建议对路由api使用长的lat。 路由api和扩展api映射的发布周期不同,您将无法更改它们。最好使用lat,lon而不是依赖用例的链接ID。使用lat,从您的rme响应中获取很长时间,我在路由api中获得了不同的链接ID。 https://route.cit.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!49.77763,9.95697&waypoint1=geo!49.67599245719612,10.035531716421247&mode=fastest%3Bcar%3Btraffic%3Aenabled&app_id=<>&app_code=<>&representation=linkPaging&language=de-de&returnElevation=true&maneuverAttributes=position%2Clength%2CtravelTime%2CstartAngle&instructionFormat=text&routeAttributes=waypoints%2Csummary