GuidesAPI Reference
Guides

How to control routing with access restrictions

Access restrictions for roads can take the following form:

  • Private access only
  • Access blocked by gates
  • Accessible at certain times only
  • Vehicle-specific access restrictions
  • Administrative restrictions for trucks, such as country-wide weekend ban in Germany
  • Road closure due to construction work

When matching a trace to a route, the API automatically avoids segments where applicable restrictions occur.

In some cases, route matching can fail if the trace is matched to a route that encounters several access restrictions.

Use access restriction-specific parameters to control how the given restriction is treated by the API - whether it's respected, ignored, or ignored only if it has a positive effect on the calculated route.

📘

Note

Not all restrictions and restriction overrides apply to all transport types.

Private access

Use the avoidPrivate parameter to control routing through private access roads.

The parameter takes the following values:

  • avoidPrivate=0: This is the default value.

Allows routing through private access roads only if a waypoint is located on a private road.

  • avoidPrivate=1: Routing through private access roads is always allowed.
  • avoidPrivate=-1: Routing through private access roads is never allowed.

Gates

Use the traverseGates parameter to control whether a route can cross gates.

Remember that crossing a gate may require opening it with a key or getting a permission to cross.

The parameter takes the following values:

  • traverseGates=false: Default value.

The route can't cross any gates.

Only emergency vehicles (mode=emergency) can cross gates.

  • traverseGates=true: The route can cross all gates.
  • traverseGates=airlineDistanceInMeters,entryPenaltyInSec:

Only the gates within the set radius (airlineDistanceInMeters) from a waypoint can be crossed.

Crossing the gate adds a one-time penalty of a certain number of seconds to the travel time (entryPenaltyInSec).

Due to the penalty, a route that doesn't cross the gate is always preferred.

Administrative restrictions for trucks

By default, all country-wide administrative restrictions for trucks of the given territory are respected.

To override this behavior, use the adminTruckRestrictions parameter:

  • adminTruckRestrictions=ignore: All administrative truck restrictions are ignored.

One-way roads

Use the oneway parameter to override the default behavior of respecting the direction of travel.

Available only for mode=emergency and mode=bicycle.

Use the parameter in the following way:

  • oneway=penalty:0.5: Allow direction of travel violation if the time benefit is greater than 0.5 seconds per meter.
📘

Note

The recommended penalty values are:

  • 0.125 for bicycles
  • 0.5 for emergency vehicles

Time or access restrictions

The ignoreWaypointVehicleRestriction parameter allows to ignore restrictions that prevent reaching the destination in situations like the following:

  • Final 200 meters of the route are in a pedestrian-only zone.
  • Truck with a fridge has permissions to travel on weekends, breaking the German weekend ban.
  • Truck has permission to enter a no-truck zone.
  • Getting around roads closed due to construction work or accidents.

The parameter takes the following value: ignoreWaypointVehicleRestriction=radius[;drivePenaltyFactor[;type[;entryPenalty]]] The makeup of the value is as follows:

  • radius: Mandatory.

Violate restrictions if necessary when within the set radius from the waypoint.

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 value: 0.

Takes values in the range from 0.0 to 10.0.

Multiplier used to control how strictly restriction violations are avoided.

Traversing a road link with restrictions becomes more expensive in terms of route path cost optimization.

  • type: Default value: allTimed.

Defines what restrictions can be violated to reach the destination.

Comma-separated list of:

  • allTimed: Allow to violate time and date-dependent access restrictions such as nightly truck ban, weekend city truck ban, delivery access only in the morning.
  • all: Allow to violate all restrictions except construction and incident-related road closures. It is important that the application verifies the violation warnings and alerts the driver, to avoid that he gets stuck at a tunnel portal or overloads a bridge.
  • construction: Allow to traverse roads closed due to construction, traffic congestion, and incidents. Best used if the driver has special permissions or is certain that local detours are available.
  • entryPenalty: Default value: 3600.

Entry penalty in seconds in the range from 0 to 7200, applied when a restriction is violated.

With the default value of 3600 (one hour), the route avoids violations unless it can't find a legal path with a detour of one hour.

Use a reduced value to allow the route to prefer shorter paths over legal paths.

Use increased values to ensure that violating restrictions is used only when there aren't any routes that don't violate restrictions available.

Examples

Reach a destination in a pedestrian zone

  • &ignoreWaypointVehicleRestriction=2000;;;3600 Within a 2 km radius of waypoints, the system will bypass non-safety critical access restrictions, incurring a 1-hour penalty.

Apply time and speed penalties for violations

  • &ignoreWaypointVehicleRestriction=500000;0.9;all;1800 Within 500 km of waypoints, the system will bypass access restrictions to generate a route, applying a 30-minute penalty and a 50% speed reduction for each violation.

Reach a destination near a road under construction

  • ignoreWaypointVehicleRestriction=2000;0.9;construction Reach a destination next to a road closed due to construction work.

Reach a specific waypoint despite restrictions

  • waypoint1=50.12,8.65;ignoreRestriction:8000,0.9,all,1800 This parameter, similar to the global parameter &ignoreWaypointVehicleRestriction, ensures waypoint1 is accessible regardless of vehicle restrictions.

    Note that while a route will be generated, truck navigation to known dead-end waypoints remains unsupported.