Search for content

Block Intersecting Roads

The blockIntersectingRoads option allows to avoid some roads, ferries or train shuttles on a route, using intersection lines.
All roads, ferries or train shuttles that intersect the polyline, are considered as blocked.
Please note that it is not always possible to avoid these features, e.g. using the blocked roads if it is the only possible route.

The intersection lines can be defined using several polylines. Refer to the API reference for a description of the format and consider the examples below.

The example below shows the consequence of a route calculation respecting the blocked roads.

 

No blocked roads

 

Roads intersecting with the red line are blocked

Using blockIntersectingRoads options

One or more polylines can be set into the options query parameter:

options[blockIntersectingRoads]=49.011965,8.381384,49.004256,8.376232

 

The blockIntersectingRoads option supports polyline. To set a polyline, just add as many intermediate points as necessary:

options[blockIntersectingRoads]=49.011965,8.381384,49.01,8.38,49.004256,8.376232

 

The blockIntersectingRoads option supports multiple polylines. To set a list of polylines, use the pipe-separator between each polyline:

options[blockIntersectingRoads]=49.011965,8.381384,49.004256,8.376232|49.0,8.38,49.0,8.40

Using blockIntersectingRoads options with Reachable API

The blockIntersectingRoads options is also available with Reachable Areas and Reachable Locations APIs.

The example below shows the effect on reachable areas.

No blocked roads

 

Result where a polyline blocks parts of the city centre.

 

Try it in the Block intersecting roads code sample.