# Find a path despite access restrictions

The road network can have several types of restrictions. Roads for example can

• have only private access
• be blocked by gates
• be closed on certain times
• have vehicle access restrictions
• have administrative wide restrictions (f.e. weekend driving restrictions for trucks in Germany)
• have construction status closed attribution

Those restrictions can lead to routes circumventing those restrictions or not being able to be calculated at all. The API supports several parameters to lift or ignore those restrictions so that routes can be calculated. In some of the cases a warning is added to the response that certain restrictions apply to the calculated route.

## Private access

The use of private streets can be granted or blocked with the parameter avoidPrivate. Accepted values are:

• avoidPrivate=1: Private road access is always allowed.
• avoidPrivate=-1: Private road access is not allowed.

## Gates

If the driver has keys or permissions to traverse gates these can be allowed to be passed via the parameter traverseGates. Accepted values are:

• traverseGates=true: All gates on a route can be traversed.
• traverseGates=airlineDistanceInMeters,entryPenaltyInSec: Only gates within the given airline distance in meters around a waypoint are considered for traversal. A one-time penalty of a specified number of seconds is added to the internal cost calculation of the route. This way, a legal route without traversing the gate is preferred over one that uses the gate.
• traverseGates=false: Using the default value 'false' ensures that no gates will be traversed, except if the vehicle type is emergency.

Almost all countries specify restrictions on allowed truck vehicle parameters like width, height, length, axles, trailers and more. By default, admin-wide truck restrictions are obeyed. The parameter adminTruckRestrictions can be used to ignore them.

## Oneway

By default, the directions of travel are obeyed. This can be modified by using the parameter oneway, specifying a penalty in seconds-per-meter. This parameter is not supported for vehicle types other than bicycles or emergencies. For example,

• oneway=penalty:0.5: allows oneway violation if the time benefit is more than 0.5 seconds/meter.

For bicycles, the recommended value is 0.125, for emergency vehicles, 0.5.

## Time or access restrictions

Often drivers need a route, even if there is some of following “problems” getting there:

• Cannot drive into the pedestrian zone for the last 200 meter.
• Weekend truck ban but your fridge truck has a special permission.
• Low bridge or no trucks zone where you have a special permission.
• Construction closed roads, accident closed roads, but there must be some way to get through/around.
• Access not permitted, because truck attributes not specified completely, like 38t allowed if you’d specify a trailer.

Of course those restrictions must not be simply ignored, but only violated if there is no other chance to reach the destination, and then having an explicit warning in the response.

The parameter &ignoreWaypointVehicleRestriction allows to configure this to your specific needs.

• radius (mandatory): Strictly stay legal and only violate restrictions if necessary while within meters airline of a waypoint (approaching it or departing from it).

Use 2 km to get out of / into pedestrian zones, private yards, 20 km to get out of /into a city, 3000 km to get through country wide truck bans or country wide weight limits.

• drivePenaltyFactor (default 0): Traversal cost multiplier (0.0 ... 10.0) created to control how strictly restrictions are avoided. Makes traversing an illegal link becomes more expensive (w.r.t. route path cost optimization).

Use 0 to pass illegal paths at no penalty, 10.0 to use illegal paths only as a last resort (10 times more cost). Usually default 0 is ok and entryPenalty should be set.

• type (default allTimed): What kind of access restrictions could be violated (if required to reach the destination). Comma separated list of following values:

allTimed can violate access restrictions that are date/time dependent (nightly truck ban, weekend city truck ban, delivery access only in the morning…), if required to reach the destination.

all can violate all kind of restrictions except construction/incident related road closures. It is important that the application verifies the violation warnings and alerts the driver, to avoid he gets stuck at a tunnel portal or overloads a bridge.

construction can traverse roads closed due to construction/traffic/incident, if required to reach the destination. This is useful, if the driver has a permission or is sure that some local detour will be available.

• entryPenalty (default 0): Traversal penalty (in seconds, 0..7200) applied once while ignoring each restriction type, like entering a 'no through traffic' area or entering an 'country wide truck restriction' area.

Use 7200 to make routing avoid such illegal path unless it takes a 2 hours detour to get there completely legal, per entering an illegal section.

### Examples

• &ignoreWaypointVehicleRestriction=2000;;;3600

Within 2 km around the waypoints return a route even if non-safety critical access restrictions must be violated, 1 hour penalty when using such illegal path.

Ensures reaching destinations in a Pedestrian Zone.

• &ignoreWaypointVehicleRestriction=500000;0.9;all;1800

Within 500 km around waypoints return a route even if access restrictions must be violated, 30 minute penalty + almost half driving speed when using such illegal path.

• ignoreWaypointVehicleRestriction=2000;0.9;construction

Reach a destination next to construction closed road.

• waypoint1=50.12,8.65;ignoreRestriction:8000,0.9,all,1800

Similar to the global parameter &ignoreWaypointVehicleRestriction which applies to all waypoints, this ensures that waypoint1 can be reached/left in any case.

We'll still get a route, although a known dead end waypoint is not reachable for trucks.