I have a list of Here Maps link Ids. I want to get their geometries. I tried calling v7 calculateroute REST API, passing a single link_id in waypoint0 and waypoint1 as below,
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={API_KEY}&mode=fastest;car&waypoint0=link!-893783351&waypoint1=link!-893783351&routeAttributes=notes&linkAttributes=shape,speedLimit
{
"response": {
"metaInfo": {
"timestamp": "2021-09-28T04:03:39Z",
"mapVersion": "8.30.124.155",
"moduleVersion": "7.2.202138-9419",
"interfaceVersion": "2.6.77",
"availableMapVersion": [
"8.30.124.155"
]
},
"route": [
{
"waypoint": [
{
"linkId": "+893783351",
"mappedPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"originalPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"type": "stopOver",
"spot": 0.4929245,
"sideOfStreet": "neither",
"mappedRoadName": "",
"label": "",
"shapeIndex": 0,
"source": "user"
},
{
"linkId": "+893783351",
"mappedPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"originalPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"type": "stopOver",
"spot": 0.4929245,
"sideOfStreet": "neither",
"mappedRoadName": "",
"label": "",
"shapeIndex": 1,
"source": "user"
}
],
"mode": {
"type": "fastest",
"transportModes": [
"car"
],
"trafficMode": "disabled",
"feature": []
},
"shape": [
"26.711034,-80.1374786",
"26.711034,-80.1374786"
],
"leg": [
{
"start": {
"linkId": "+893783351",
"mappedPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"originalPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"type": "stopOver",
"spot": 0.4929245,
"sideOfStreet": "neither",
"mappedRoadName": "",
"label": "",
"shapeIndex": 0,
"source": "user"
},
"end": {
"linkId": "+893783351",
"mappedPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"originalPosition": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"type": "stopOver",
"spot": 0.4929245,
"sideOfStreet": "neither",
"mappedRoadName": "",
"label": "",
"shapeIndex": 1,
"source": "user"
},
"length": 0,
"travelTime": 0,
"maneuver": [
{
"position": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"instruction": "Take ramp.",
"travelTime": 0,
"length": 0,
"id": "M1",
"_type": "PrivateTransportManeuverType"
},
{
"position": {
"latitude": 26.711034,
"longitude": -80.1374786
},
"instruction": "Arrive at your destination.",
"travelTime": 0,
"length": 0,
"id": "M2",
"_type": "PrivateTransportManeuverType"
}
]
}
],
"note": [
{
"type": "violation",
"code": "routingOptionViolated",
"text": "startDirection"
}
],
"summary": {
"distance": 0,
"trafficTime": 0,
"baseTime": 0,
"flags": [
"tollroad"
],
"text": "The trip takes <span class=\"length\">0 m</span> and less than <span class=\"time\">1 min</span>.",
"travelTime": 0,
"_type": "RouteSummaryType"
}
}
],
"language": "en-us"
}
}
But the shape returned in the response doesn't seem to be the shape of the link, even though the developer guide mentions that the parameter "linkAttributes" can be used to get the link shape.
Please advise if I am doing anything wrong here. Also, if I can use another API to get shape of a link.
I am fine with making an API call per link_id.