You can calculate a route to avoid specific map features, routing zones, and areas.
Map features can be specified by providing a feature category. For example, to calculate a route that avoids toll roads, specify
avoid[features]=tollRoad in your route request. To calculate a route that avoids environmental zones, specify
To avoid specific features of the map, provide an identifier of the feature that you want to avoid. For example, specify
avoid[segments]=here:cm:segment:207551710 to calculate a route that avoids a specific segment, a part of Invalidenstrasse in Berlin. To calculate a route that avoids one specific environmental zone ("Berlin Umweltzone"), specify
You can provde a user specified bounding box to avoid an entire area. For example, a route that avoids the Berlin area can be calculated by providing
Sometimes no route is possible that avoids the feature, for example specifying
avoid[features]=ferry to an otherwise inaccessible island. In this case, a route can be returned that makes minimal use of the feature. However, there is no guarantee that a route is returned, if it is only possible by violating
If a route is returned that violates the
avoid request a notice is included to indicate that the route does not avoid the feature.
For more code samples with the
avoid option, see these tutorials:
A routing zone is a group of roads that share the same regulations. Currently, three zone categories are supported, namely
environmental (see API Reference for more details).
vignette roads are found in some European countries. The system works based on payment for a fixed time period (for example, one year). A traveler may want to avoid those roads to save the annual cost for occasional crossings.
congestionPricing zones are another category of routing zones that consists of roads usually in the city centers, airports, bridges, or other busy areas. It is used to mitigate traffic congestion by charging a higher price in rush hours.
environmental zones, on the other hand, are designed to improve air quality in urban areas by excluding vehicles under certain pollution standards from entering them.
For each category, there are multiple instances. For example, most cities in Germany have their own environmental zones. Each zone instance has its unique ID to identify it respectively.
Information about the various routing zones originates from the respective catalogs of platform.here.com. For example https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview for Environmental Zones. If you do not have access to the platform catalogs then you can use the routing response to get this information.
A route can be planned avoiding certain categories of zones or certain instances of zones. Specifically, there are three ways to use the API:
For more code samples that specify zones, see these tutorials:
avoid[areas] parameter enables calculating routes that avoid the specified areas.
For performance considerations, different algorithms are used for avoiding areas based on the size of these areas. If the area specified is large and the only possible route passes the avoided area, the part of the route inside the avoided area may not be optimal.
Scenarios in which the route may go through an avoided area: