Routing zones in HERE Map Attributes API v8
Use the ROUTING_ZONES layer to query for supported routing zones. The layer includes zone identifiers you can use in HERE Routing API v8. For example, in the avoid[zoneIdentifiers] parameter to define zones to avoid when calculating a route. The attributes (columns) of ROUTING_ZONES layer are:
| Attribute | Description |
|---|---|
ZONE_ID | Zone identifier. |
ZONE_TYPE | Type of zone. |
ZONE_NAME | Name of the zone. |
ISO_COUNTRY_CODE | ISO code of the country in which the zone is located. |
Get routing zones
Use the /v8/maps/attributes resource can to get the data from ROUTING_ZONES layer. The required parameters are layers, in, and either an apiKey or app_id and app_code.
Send the following request to get the supported routing zones from all regions.
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes?'\
'layers=ROUTING_ZONES'\
'&in=all'\
'&apiKey={YOUR_API_KEY}'Use the &mapName parameter to get the supported routing zones from a region such as WEU (Western Europe), EEU (Eastern Europe), NA (North America), APAC (Asia-Pacific). The following request gets the supported routing zones from the NA region.
Sample request
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes?'\
'layers=ROUTING_ZONES'\
'&in=all'\
'&mapName=NA'\
'&apiKey={YOUR_API_KEY}'Sample response
Click to view the sample response.
{
"geometries": [
{
"attributes": {
"ZONE_NAME": "NYC CONGESTION PRICING",
"ZONE_ID": "here:cm:tollsystem:8131",
"ISO_COUNTRY_CODE": "USA",
"ZONE_TYPE": "congestion"
},
"layerId": "ROUTING_ZONES"
},
{
"attributes": {
"ZONE_NAME": "Hidalgo Hoy No Circula",
"ZONE_ID": "here:cm:envzone:456",
"ISO_COUNTRY_CODE": "MEX",
"ZONE_TYPE": "environmental"
},
"layerId": "ROUTING_ZONES"
},
{
"attributes": {
"ZONE_NAME": "Zona Metropolitana Valle de México",
"ZONE_ID": "here:cm:envzone:79",
"ISO_COUNTRY_CODE": "MEX",
"ZONE_TYPE": "environmental"
},
"layerId": "ROUTING_ZONES"
},
{
"attributes": {
"ZONE_NAME": "San Jose Restriccion Vehicular",
"ZONE_ID": "here:cm:envzone:458",
"ISO_COUNTRY_CODE": "CRI",
"ZONE_TYPE": "environmental"
},
"layerId": "ROUTING_ZONES"
}
]
}Filtering
Use the &filter parameter can to filter out the supported routing zones. You can apply the filter to any attribute of the ROUTING_ZONES layer. A filter should be an SQL expression and it must be URL-encoded.
For example, use the following request to get the supported routing zones from Mexico, referred to by its ISO country code, MEX.
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes?'\
'layers=ROUTING_ZONES'\
'&in=all'\
'&filter=ISO_COUNTRY_CODE%3D%22MEX%22'\
'&apiKey={YOUR_API_KEY}'This request returns only the environmental zones from all regions.
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes?'\
'layers=ROUTING_ZONES'\
'&in=all'\
'&filter=ZONE_TYPE%3D%22environmental%22'\
'&apiKey={YOUR_API_KEY}'You can apply the filter on multiple attributes of the layer. See this in the example request that gets all environmental zones from Germany.
curl -gX GET 'https://smap.hereapi.com/v8/maps/attributes?'\
'layers=ROUTING_ZONES'\
'&in=all'\
'&filter=ISO_COUNTRY_CODE%3D%22DEU%22%20and%20ZONE_TYPE%3D%22environmental%22'\
'&apiKey={YOUR_API_KEY}'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