Get route attributes

Spans provide you with various granular route attributes. To use spans, specify the span parameter in your route request. You can specify spans=names,speedLimit to request all the street names and their speed limits.

Note

The segmentRef span includes references to the HERE Map Content topology segment used by the route.

As the spans refer to the polyline, you need to specify return=polyline as well.

curl -X GET \
  'https://router.hereapi.com/v8/routes?transportMode=car&origin=52.5308,13.3847&destination=52.5323,13.3789&return=polyline&spans=streetAttributes,length&apikey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "7c090f54-e0fc-4591-9bec-e414ce5bca77",
      "sections": [
        {
          "arrival": {
            "place": {
              "location": {
                "lat": 52.53232637420297,
                "lng": 13.378873988986016
              },
              "type": "place"
            },
            "time": "2019-12-09T14:38:44+01:00"
          },
          "departure": {
            "place": {
              "location": {
                "lat": 52.53098367713392,
                "lng": 13.384566977620125
              },
              "type": "place"
            },
            "time": "2019-12-09T14:37:23+01:00"
          },
          "id": "d50b2080-0839-407c-9472-a5b23e756e23",
          "polyline": "BGwynmkDu39wZvBtFAA3InfAAvHrdAAvHvbAAoGzF0FnGoGvHsOvRAA8L3NAAkSnVAAoGjIsEzFAAgFvHkDrJAAwHrJoVvb0ezoBAAjInVAA3N_iBAAzJ_Z",
          "spans": [
            {
              "length": 113,
              "offset": 0,
              "streetAttributes": [
                "rightDrivingSide",
                "dividedRoad"
              ]
            },
            {
              "length": 425,
              "offset": 8,
              "streetAttributes": [
                "rightDrivingSide"
              ]
            }
          ],
          "transport": {
            "mode": "car"
          },
          "type": "vehicle"
        }
      ]
    }
  ]
}

results matching ""

    No results matching ""