Route Violations
Characteristic
Short description
When there is no valid route A route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. from start to destination, because there is at least one segment which is prohibited for the given vehicle The term vehicle describes what is being routed or planned for. Vehicles are used in route calculation, distance matrix calculation and effectively also in tour planning. In route calculation, vehicle properties like overall size, weight and speed are in focus. In tour planning, it is vehicle properties like capacity and availability. Commonly a vehicle is motorized, like a truck - including its trailer or a car. However also a bike or even a pedestrian are included in this definition., the resulting route is marked as violated. A route is violated only if there is no other valid route.
Use
Route violations are activated by default and can be controlled through the routing profile A profile is a collection of parameters used to configure the request. Full profiles consist of a number of specialized sub-profiles like the VehicleProfile which describes the properties of a vehicle. field Violations.enabled.
Detailed Consideration
Routes are usually violated if one of the waypoints A waypoint is a geographic location used to specify start, destination and possible stopovers for a route. is on a road which is prohibited for the current vehicle, e.g. the vehicle is generally prohibited, exceeds a weight limit, carries hazardous goods, or violates some other regulation.
It may also happen that one of the waypoints is in an area which has only one access road which is prohibited for the vehicle, e.g. due to a height limit, or the access is restricted by a gate or bollard. See also Unreachable Route Location.
In case restrictions on road segments or nodes are violated the field RouteResponse.violated is set to true. The same flag is present for route legs, segments and nodes as well as for distance matrix relations.
In order to best find the violated segments or nodes along the route, there is a RouteViolationEvent for each kind of violation which contains more information including its reason. There is an event when entering an area and another one when exiting an area marked with the AccessType ENTER and EXIT. If a single position is passed such as a gate, there is only one event marked with AccessType PASS.
Currently, prohibited segments and long-term traffic incidents can be violated.
Prohibited segments have a penalty of 2501. Very often access in pedestrian zones or other restricted areas is allowed for delivery vehicles. These segments have a penalty of 2501 if the flag isDelivery is not set. If it is set, i.e. the vehicle is marked as a delivery vehicle, the penalty is 2500 which has a similar effect on the route calculation, but there is no violated segment and no event. See the documentation of Feature Layer PTV_TruckAttributes for details on these regulations.
Long-term traffic incidents with a zero speed (such like road works that cause a road closure for several weeks) can also be violated. In this case, the travel time of the segments is the maximum travel time without this blocking.
Some violations are only available when using a PathWaypoint. For example, a path waypoint on an highway with a storedProfile bicycle
will result in a violated route.
When disabling route violations, such route requests result in a RouteNotFoundException.
Good to know
Limitations
Currently the following restrictions can produce violations:
- Prohibited roads from the Feature Layer PTV_TruckAttributes.
- Roads prohibited by gates, bollards or other access restrictions.
- Roads generally prohibited for trucks.
- Long-term blockings from the Feature Layer PTV_TrafficIncidents.
- Roads prohibited by a penalty of 2501 specified in residentsOnlyPenalty, urbanPenalty or seasonalClosurePenalty
- Roads specified in prohibitedSegmentsByIntersectingPolylines.
Roads generally prohibited for cars are not fully supported, but it is guaranteed that a violated route does not contain a segment driving the wrong direction of a one-way road.
Usually, a route is violated only if there is no other valid route. In mountain areas or fjords it may happen that the route is violated even if there is a valid route as the detour is too long.
Related Topics
Integration Sample | Unreachable Route Location |
Showcase | Consider Route Events |