If there is no valid route for the selected vehicle but the resulting route can be calculated using roads which are actually prohibited, the route is marked as violated.
When enabling drivers' working hours but the resulting route exceeds one of the defined limits, the route is also marked as violated.
This violated flag is not only available for the complete route, but also for each leg. When calculating the estimated time of arrival (ETA) remaining waypoints can also be marked as violated for the same reasons.
The list of events contains violation events for each such violation in order to find out where it occurs and what the reason is. Request VIOLATION_EVENTS to obtain these events.
When do violations occur?
Usually, prohibited roads are avoided during route calculation, but there are some typical situations where it is not possible to avoid such roads.
- A waypoint is located directly on such a road. The route will use that road and be marked as violated.
- A waypoint is on a permitted road or in a permitted area, but this area can be reached only using a prohibited road. The route will use these prohibited roads to reach the destination and be marked as violated.
- The best connection between two waypoints is prohibited but the detour is too long. The route will use the prohibited connection and be marked as violated. This will most likely happen in the mountains where detours to avoid a mountain pass can be very long or when there is a short route crossing a restricted area while the detour around this area is very long.
What are the reasons for a violation?
The violation event contains a type which gives information on the kind of violation. There are the following types:
- PROHIBITED: There are several roads which are prohibited for motorized traffic such as some roads in city centers, parks, forests, farmland and so on. This is usually the reason when a waypoint is located directly on such a road.
- DELIVERY_ONLY: Various roads are marked as delivery only, i.e. vehicles may enter or exit roads within such a delivery area, but they may not pass the area as a shortcut. This often applies to factory premises, city centers and lots of other roads open only to delivery traffic. Trucks are allowed to pass these roads, but cars and vans are not. So, this type will be present only for cars and vans.
- RESTRICTED_ACCESS: Some roads can be accessed only by passing a gate or a bollard. Usually such a gate or bollard can be opened for people having a permission or a key. When a waypoint can be reached only by passing that gate or bollard, this type will be present. The accessType will usually be PASS.
- VEHICLE_PROPERTY: Lots of roads are restricted to vehicles by certain properties. This covers weight or height limits, but also access to low-emission zones requiring the proper badge or emission standard. Other roads are prohibited for trucks in general. There are even combined restrictions such as a weight limit which does not apply to delivery vehicles. So, this type will be present when roads are prohibited due to such reasons. Note that this also covers restrictions defined in some custom road attribute scenario used in the request.
- COMBINED_TRANSPORT: Some ferries do not carry trucks or motorized vehicles, at all. This is usually the reason when a waypoint is located on an island which can be reached only be a passenger ferry. Very likely, the roads on the island are also prohibited for the same vehicles so that the type PROHIBITED will also be present.
- SCHEDULE: This type is not related to roads but will be present when defining drivers' working hours and restrictions are exceeded such as the maximum driving time or a waypoint cannot be reached within one of the opening intervals. The parameter scheduleViolationTypes contains details on what restriction is exceeded.
- BLOCKED_ROAD_BY_INTERSECTION: Roads can also be prohibited using the parameter options[blockIntersectingRoads] in the request. When such a prohibited road is used for the same reasons as mentioned above, this type will be present.
Roads and their restrictions depend on the available data and are not modeled in the same ways worldwide, therefore also the violation type may depend on the data. Pedestrian zones, for example, are usually prohibited for motorized vehicles but open for delivery vehicles. That may not apply to all regions of the world.
Further information
It may be useful to mark violated roads on the map. In order to obtain the polyline of the violated roads, request VIOLATION_EVENTS_POLYLINE in the request. Each violation event in the response with accessType ENTER then contains the polyline of the violated road. The polyline will not be present for EXIT which would just be a duplicate nor for PASS which represents rather a point than a polyline. For PASS the position of the event is relevant.