Routing API Developer's Guide

Requesting a Route Avoiding an Area

To calculate directions between two coordinates without traveling through a specified area, use the CalculateRouteRequest service specifying the start (waypoint0), endpoint (waypoint1) and area to avoid (avoidareas as a rectangular area, defining the top left and bottom right corners). The string geo! indicates that you are specifying each point using latitude and longitude. Note that you also have to specify an app_id and app_code (see Acquiring Credentials), type of route calculation and whether to take traffic into account.

The following example calculates a route from the Westin Grand hotel (52.516858379, 13.3884717) at Unter den Linden in Berlin to the Staatsoper in Berlin (52.51733824, 13.394678415) avoiding passing the Deutsche Guggenheim (52.51704771, 13.39131492) by specifying a rectangle that contains it (top left 52.517100760,13.3905424488 and bottom right 52.5169701849,13.391808451), and also the fastest route for a car without taking traffic conditions into account.
Figure 1. Example of route avoiding an area.
In the following example multiple rectangular areas are specified. The query results in a route avoiding all specified areas.
Note: Multiple avoid areas have to be specified using character "!" as separator.
Figure 2. Example of route avoiding multiple areas.

In the following example an area is specified in a way, that it cannot be avoided. Note that routeattributes request parameter is used to obtain notes.

In such case resulting route passes through specified area and JSON output contains a "violation" note.

note : [ <1 elem>
  0 : {
    type : "violation"
    code : "routingOptionViolated"
    text : "blockedRoad"
Figure 3. Example of route not possible to avoid specified area.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on