Avoid zones by category

In some cases, you may want to avoid the entire category of the zones. This can be done with avoid[zoneCategories] option. For example, the following command can be used to avoid Berlin environmental zones by avoiding all zones of type environmental:

curl -X GET \
  'https://router.hereapi.com/v8/routes?destination=52.451857,13.41379&origin=52.565889,13.417365&transportMode=car&avoid[zoneCategories]=environmental&apikey={YOUR_API_KEY}'
avoid environmental zones
Figure 1. avoid environmental zones

The blue line in the above image shows the route that avoids all the environmental zones. By comparison, the pale blue line shows the route which passes through the city without avoidance.

Note

You can replace the avoidance option with avoid[zoneIdentifiers]=here:cm:envzone:2. here:cm:envzone:2 is the ID referring to "BERLIN UMWELTZONE", which dominates the central area of Berlin, so that avoiding this zone effectively avoids the environmental zone in this case.

For a request that demonstrates how to get an ID, see Get routing zone ID.

results matching ""

    No results matching ""