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.
This violation flags could be retrieved the if VIOLATION_FLAGS are requested in the results.
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?
A violation could happen when:
- 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.
- 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.
- 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.
- 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. Note that this also covers restrictions defined in some custom road attribute scenario used in the request.
- 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.
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.