Avoid areas

The avoid[areas] parameter enables the user to calculate 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 is through 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:

  • No alternate route could be calculated from source to destination.
  • Origin, destination or intermediate waypoint is within the avoided area.

The following request avoids going through an area in the Tiergarten park:

curl -X GET \
  'https://router.hereapi.com/v8/routes?origin=52.522297,13.353296&destination=52.508309,13.355633&transportMode=car&avoid[areas]=bbox:13.37588,52.51061,13.34226,52.51892&apikey={YOUR_API_KEY}'
avoid areas
Figure 1. avoid areas

The resulting route takes a detour in order to avoid the specified area.

results matching ""

    No results matching ""