After building the indexed road graph based on the source data, the set of road connectivity characteristics and their parameters are fixed. This allows you to create auxiliary data structures, the use of which significantly increases the calculation speed. The logical roads graph at the time of creation of the index structure becomes unchanged.
Often there are situations when certain road segments should be ignored, since traffic is prohibited (the road is blocked, repairs are underway, etc.). For such cases, the TrueDrive technology provides a specific ability of setting barriers.
Recalculation of found route by adding barrier
Barriers can be of point, polyline or polygon type. The point barriers snap to the nearest road segment and build the virtual barrier on that segment. The polyline barrier marks as impassable those segments that intersect with the given polyline. Same way, the polygon barriers mark those segments that fall completely or partially inside the polygon.
Barriers can be semi-transparent, i.e. not strictly prohibit traffic, but increase the travel time on the given segment. This mechanism allows you to define areas of unwanted presence. As a result, the network analysis algorithm would try to bypass the marked area until it becomes irrational. If such bypass is not possible or the bypass cost is too high considering the selected optimization, then the pass with minimal presence in the undesirable area is allowed.
The barrier transparency level is set by the penalty parameter with the following values:
- -1 – absolute barrier (traffic prohibited)
- 0 - instant teleportation (cost travel on segment is ignored)
- 0.5 - movement speed twice as fast
- 1 - no barrier
- 2 - movement speed twice as slow
Thus, setting barrier on the road can either completely prohibit traffic or reduce the passage priority on the given segment.
A special case is setting the penalty parameter in the range from 0 to 1. Values from this range allow, on the contrary, to increase the travel speed along the road segment. This possibility can be used in situations where road characteristics have been improved, for example, the asphalt pavement has been laid over the gravel embankment.
The use of barriers allows to decrease dependance on the need to recalculate the road graph index, but with a significant increase in the number of specified barriers, it is worth changing the source road network data and recalculating the index file.