使用 RouteeId 检索先前计算的路线 [HERE Maps] 失败并出现 RouteNotReconstructed 错误

Retrieving previously calculated route [HERE Maps] using RouteeId fails with RouteNotReconstructed error

我正在根据用户输入计算路线。然后存储 routeId 和我需要的任何其他信息。但是道路的形状是我偶尔需要的东西;当用户想要再次预览道路时。 因为我不想存储我尝试使用 getroute 端点 (https://developer.here.com/documentation/routing/topics/resource-get-route.html#resource-get-route) 的形状中的所有点,但我得到了这个响应:

{
    "_type": "ns2:RoutingServiceErrorType",
    "type": "ApplicationError",
    "subtype": "RouteNotReconstructed",
    "details": "Error is NGEO_ERROR_ROUTE_DESERIALIZATION",
    "additionalData": [
        {
            "key": "error_code",
            "value": "NGEO_ERROR_ROUTE_DESERIALIZATION"
        }
    ],
    "metaInfo": {
        "timestamp": "2018-08-01T15:01:56Z",
        "mapVersion": "8.30.86.150",
        "moduleVersion": "7.2.201830-34436",
        "interfaceVersion": "2.6.34",
        "availableMapVersion": [
            "8.30.86.150"
        ]
    } 
}

所以问题是:为什么我会收到错误消息?根据 API 文档 https://developer.here.com/documentation/routing/topics/resource-type-error-route-not-reconstructed.html,我可以排除错误的 routeId(它适用于例如今天保存的路线,但不适用于旧路线)。 该路线是使用相同版本 (7.2)

计算的

routeId是否只保存一定时间? 如果有,多长时间?

RouteID随地图版本变化。 https://developer.here.com/documentation/routing/topics/request-route-information.html

您需要定期重新计算以获得最新的 RouteID。