Granular Route Attributes

Spans provide you with various route attributes. To use spans, specify the span parameter in your route request.

For example, you can specify spans=names,speedLimit to request all the street names and their speed limits.

Note

The segmentId span includes the HERE Map Content topology segment IDs used by the route.

Since the spans refer to the polyline, then return=polyline must be provided as well.

Example

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'
    "routes": [
        {
            "id": "7c090f54-e0fc-4591-9bec-e414ce5bca77",
            "sections": [
                {
                    "arrival": {
                        "place": {
                            "location": {
                                "lat": 52.53232637420297,
                                "lng": 13.378873988986015
                            },
                            "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 ""