Get map attributes for a reverse-geocoded position
The Map Attribute Service offers HERE map data for a variety of use cases. This tutorial demonstrates how to retrieve road attributes for simple or multiple segment references.
Segment references of the coordinates can be retrieved by calling HERE Reverse Geocoding or HERE Route Matching API. Please refer to corresponding API documentation. A customer could collect multiple segment references (for example, by calling multi-reverse geocoder) of the same vehicle/asset, or multiple different vehicles/assets and send them in a batch to retrieve their road attributes.
Map attributes of multiple road segments
A vehicle driving along a route can return multiple segment references of the segment or segments (separated by ;) it passes through. From these segment references and a layer ID, the Map Attributes API calculates HERE map data.
Sample request
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes/segments?'\
'attributes=SPEED_LIMITS_FCn(*)'\
'&segmentRefs=%241%3A87628529%230.725739..0.725739%3B%241%3A89921205%230..0.780687'\
'&apiKey={YOUR_API_KEY}'Response
Click to view the sample response.
{
"refReplacements": {
"0": ":1742895365354:",
"1": "here:cm:segment"
},
"segments": [
{
"segmentRef": "$0:23600842:$1:87628529#+0.71977..1",
"attributeDirection": "+",
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "50",
"TO_REF_SPEED_LIMIT": "50",
"SPEED_LIMIT_SOURCE": "2",
"SPEED_LIMIT_UNIT": "K"
}
]
}
},
{
"segmentRef": "$0:23600842:$1:89921205#+0..0.50234",
"attributeDirection": "+",
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "50",
"TO_REF_SPEED_LIMIT": "50",
"SPEED_LIMIT_SOURCE": "2",
"SPEED_LIMIT_UNIT": "K"
}
]
}
},
{
"segmentRef": "$0:23600842:$1:89921205#+0.50235..1",
"attributeDirection": "+",
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "50",
"TO_REF_SPEED_LIMIT": "50",
"SPEED_LIMIT_SOURCE": "2",
"SPEED_LIMIT_UNIT": "K"
}
]
}
}
]
}Link to demo
To see an interactive demo, follow this link: https://demo.support.here.com/examples/v3.1/map_attributes_segments
Response attributes are associated with layers. To see a list of the available layers and their attributes, access the following URL:
https://smap.hereapi.com/v8/maps/layers/list.html?&apiKey={YOUR_API_KEY}Updated last month