Search for content

Avoid

The avoid option allows to avoid toll, ferries or train shuttles and highways on a route. This can be useful to reduce extra costs or to calculate a route for vehicles which must not use highways such as agricultural vehicles. On the other hand, this could lead to longer routes or even to undesired results, e.g. avoiding toll in a country with a lot of toll roads.

Please note that it is not always possible to avoid these features, e.g. routing to a waypoint on an island only reachable via ferry. In such a case the ferry is used anyway and a route is calculated as the goal is to avoid and not to prohibit the ferry.

The example below shows the avoidance of ferries:

 

Using ferries (default)



Avoiding ferries

 

Using avoid options

One or more avoid options can be set using the options query parameter:

options[avoid]=TOLL,FERRIES

Avoid features

The following features can be avoided:

 

Avoid featureDescription
TOLLAvoid toll roads. If this is not possible and TOLL_COSTS are requested, toll costs will appear in the response. In particular, if a waypoint is located on a toll road, this toll road will be used but left as soon as possible.
FERRIESAvoid transportation via ferries. If this is not possible and COMBINED_TRANSPORT_EVENTS are requested, ferries will appear as combined transport BOAT in the response.
RAIL_SHUTTLESAvoid transportation via rail shuttles. If this is not possible and COMBINED_TRANSPORT_EVENTS are requested, rail shuttles will appear as combined transport RAIL in the response.
HIGHWAYSAvoid highways and motorways. If a waypoint is located on a highway, the waypoint will be matched to the nearest road which is not a highway. This is to make sure that, for example agricultural vehicles, use the paths along the fields when they are located directly next to a highway.

 

Try it in the Avoid code sample.