Get map attributes along a path
HERE Map Attributes API v8 offers HERE map data for a variety of use cases. This sample demonstrates how to pick additional road attributes along a path, which might be a precalculated route. This feature requires a list of contiguous segment references.
Topology segment references
The tutorial shows how to enrich a route with additional information based on all HERE map data. The route can be provided as a list of contiguous segment references literals or as a flexible polyline.
Segment references are described in the HERE Routing API reference (see segmentRef in spans in HERE Routing API v8 API reference). Such a reference needs also latitude, longitude, remaining time and the functional class of the segment for efficient lookup of the data.
Sample request
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes/path?'\
'transportMode=car'\
'&segmentRefs=$1%3A87628529%230..725739'\
'&attributes=ROAD_GEOM_FCn(*),ROAD_NAME_FCn(NAMES),LINK_ATTRIBUTE_FCn(*)'\
'&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..0.35066",
"attributeDirection": "+",
"attributes": {
"LINK_ATTRIBUTE_FCN": [
{
"ISO_COUNTRY_CODE": "DEU",
"VEHICLE_TYPES": "1023",
"URBAN": "Y",
"TRANSPORT_VERIFIED": "Y",
"FUNCTIONAL_CLASS": "3",
"CONTROLLED_ACCESS": "N",
"LIMITED_ACCESS_ROAD": "N",
"TRAVEL_DIRECTION": "B",
"BOAT_FERRY": "N",
"RAIL_FERRY": "N",
"MULTI_DIGITIZED": "N",
"DIVIDER": "N",
"DIVIDER_LEGAL": "N",
"FRONTAGE": "N",
"PAVED": "Y",
"RAMP": "N",
"PRIVATE": "N",
"POI_ACCESS": "N",
"INTERSECTION_CATEGORY": "0",
"SPEED_CATEGORY": "6",
"LANE_CATEGORY": "1",
"COVERAGE_INDICATOR": "N0",
"TO_REF_NUM_LANES": "1",
"FROM_REF_NUM_LANES": "1",
"PHYSICAL_NUM_LANES": "3",
"LOW_MOBILITY": "3",
"PUBLIC_ACCESS": "Y",
"ROUTE_TYPES": "8"
}
],
"ROAD_GEOM_FCN": [
{
"LONG_HAUL": "N",
"NAME": "L3202 / Freigerichter Straße",
"TUNNEL": "N",
"BRIDGE": "N",
"LAT": "5020318,36",
"LON": "917879,26",
"ZLEVEL": ",",
"ELEVATION": ","
}
],
"ROAD_NAME_FCN": [
{
"NAMES": "GERBNL3202\u001e\u001eGERY\"?El %tsvaI|?Un|\"draI|sIC \"nUI \"tsvaI;GERN\"?El \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI;GERN\"lant|Stra:|s@ %draI|taU|z=nt|%tsvaI|hUn|d6t|\"tsvaI;GERN\"lant|Stra:|s@ \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI\u001dGERBNFreigerichter Straße\u001e\u001eGERY\"fraI|g@|%rIC|t6 \"Stra:|s@"
}
]
}
},
{
"segmentRef": "$0:23600842:$1:87628529#+0.35067..0.71976",
"attributeDirection": "+",
"attributes": {
"LINK_ATTRIBUTE_FCN": [
{
"ISO_COUNTRY_CODE": "DEU",
"VEHICLE_TYPES": "1023",
"URBAN": "Y",
"TRANSPORT_VERIFIED": "Y",
"FUNCTIONAL_CLASS": "3",
"CONTROLLED_ACCESS": "N",
"LIMITED_ACCESS_ROAD": "N",
"TRAVEL_DIRECTION": "B",
"BOAT_FERRY": "N",
"RAIL_FERRY": "N",
"MULTI_DIGITIZED": "N",
"DIVIDER": "2",
"DIVIDER_LEGAL": "Y",
"FRONTAGE": "N",
"PAVED": "Y",
"RAMP": "N",
"PRIVATE": "N",
"POI_ACCESS": "N",
"INTERSECTION_CATEGORY": "0",
"SPEED_CATEGORY": "6",
"LANE_CATEGORY": "1",
"COVERAGE_INDICATOR": "N0",
"TO_REF_NUM_LANES": "1",
"FROM_REF_NUM_LANES": "1",
"LOW_MOBILITY": "3",
"PUBLIC_ACCESS": "Y",
"ROUTE_TYPES": "8"
}
],
"ROAD_GEOM_FCN": [
{
"LONG_HAUL": "N",
"NAME": "L3202 / Freigerichter Straße",
"TUNNEL": "N",
"BRIDGE": "N",
"LAT": "5020354,17,21",
"LON": "917905,12,15",
"ZLEVEL": ",,",
"ELEVATION": ",,"
}
],
"ROAD_NAME_FCN": [
{
"NAMES": "GERBNL3202\u001e\u001eGERN\"lant|Stra:|s@ \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI;GERY\"?El %tsvaI|?Un|\"draI|sIC \"nUI \"tsvaI;GERN\"?El \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI;GERN\"lant|Stra:|s@ %draI|taU|z=nt|%tsvaI|hUn|d6t|\"tsvaI\u001dGERBNFreigerichter Straße\u001e\u001eGERY\"fraI|g@|%rIC|t6 \"Stra:|s@"
}
]
}
},
{
"segmentRef": "$0:23600842:$1:87628529#+0.71977..1",
"attributeDirection": "+",
"attributes": {
"LINK_ATTRIBUTE_FCN": [
{
"ISO_COUNTRY_CODE": "DEU",
"VEHICLE_TYPES": "1023",
"URBAN": "Y",
"TRANSPORT_VERIFIED": "Y",
"FUNCTIONAL_CLASS": "3",
"CONTROLLED_ACCESS": "N",
"LIMITED_ACCESS_ROAD": "N",
"TRAVEL_DIRECTION": "B",
"BOAT_FERRY": "N",
"RAIL_FERRY": "N",
"MULTI_DIGITIZED": "N",
"DIVIDER": "1",
"DIVIDER_LEGAL": "Y",
"FRONTAGE": "N",
"PAVED": "Y",
"RAMP": "N",
"PRIVATE": "N",
"POI_ACCESS": "N",
"INTERSECTION_CATEGORY": "0",
"SPEED_CATEGORY": "6",
"LANE_CATEGORY": "1",
"COVERAGE_INDICATOR": "N0",
"TO_REF_NUM_LANES": "1",
"FROM_REF_NUM_LANES": "1",
"PHYSICAL_NUM_LANES": "3",
"LOW_MOBILITY": "3",
"PUBLIC_ACCESS": "Y",
"ROUTE_TYPES": "8"
}
],
"ROAD_GEOM_FCN": [
{
"LONG_HAUL": "N",
"NAME": "L3202 / Freigerichter Straße",
"TUNNEL": "N",
"BRIDGE": "N",
"LAT": "5020392,30",
"LON": "917932,16",
"ZLEVEL": ",",
"ELEVATION": ","
}
],
"ROAD_NAME_FCN": [
{
"NAMES": "GERBNL3202\u001e\u001eGERN\"lant|Stra:|s@ \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI;GERY\"?El %tsvaI|?Un|\"draI|sIC \"nUI \"tsvaI;GERN\"?El \"tsvaI|?Un|%draI|sIC \"nUl \"tsvaI;GERN\"lant|Stra:|s@ %draI|taU|z=nt|%tsvaI|hUn|d6t|\"tsvaI\u001dGERBNFreigerichter Straße\u001e\u001eGERY\"fraI|g@|%rIC|t6 \"Stra:|s@"
}
]
}
}
]
}Link to demo
To see an interactive demo, follow this link: https://demo.support.here.com/examples/v3.1/map_attributes_path
Besides the input parameters of HERE Map Attributes API v8, this demo accepts as input a GET request submitted to the HERE Routing API v8 or two sets of coordinates (origin and destination of the route). The demo then extracts the relevant data from the response returned by the HERE Routing API.
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 7 days ago