TurnAutoProcess |
Top Previous Next |
This method allows to automatically detect turns and add turn delays through out your network.
You can either use the built-in rules for adding delays for T-junctions and normal junctions, or override these with events.
In any case, it should be specified if traffic is right- or left-hand. Left-hand is known from UK, Ireland, Australia, New Zealand, Japan, India, South Africa etc.
It should also be specified if any nodes should be skipped completely. This could be nodes / junctions which are part of ramps or use traffic lights, so you want to set up different rules.
We suggest calling TurnExportGIS once you have called TurnAutoProcess to see what it actually gives in minutes.
This method is quite slow for large networks, so use it with care.
Events
When using the events you will just get a list of links back, making up the intersection. This includes intersections or nodes with degree > 2. The list is ordered in the same way as is shown on the small maps below.
T-junctions: TTurnTEvent = procedure(Sender: TObject; node, link1, link2, link3: integer)
Normal junctions: TTurnEvent = procedure(Sender: TObject; node: integer; links: TIntegerArray)
Built-in rules
Delays for each road class in the network is supplied as a TRoadClassTurnCost object. For all links in each intersection the delay is then looked up, based upon their road class. If a turn involves crossing multiple traffic flows in the intersection, these are added together as can be seen here:
For a T-junction, where 1-2 is the main road:
1---+---2 | 3
Delays for right-hand traffic:
From 3 to 1: 1.5 * (delay1+delay2) From 3 to 2: delay1 From 2 to 3: delay1 Other turns: No delay
Delays for left-hand traffic:
From 3 to 1: delay2 From 3 to 2: 1.5 * (delay2 + delay1) From 1 to 3: delay2 Other turns: No delay
Main road is determined from geometry: The link combination closest to a straight line is the main road.
For a normal intersection, where 1-3 is the main road:
Left-hand traffic 2 | 1---+---3 | 4
Right-hand traffic 4 | 1---+---3 | 2
From 1 to 4: delay3 From 2 to 1: 1.5 * (delay1 + delay3 + delay4) From 2 to 3: delay1 From 2 to 4: 1.5 * (delay1 + delay3) From 3 to 2: delay1 From 4 to 1: delay3 From 4 to 2: 1.5*(delay1 + delay3) From 4 to 3: 1.5*(delay1 + delay2 + delay3) Other turns: No delay
Main road gets detected from the delays. Largest delay means main road.
If opposing roads, 1-3, can't be identified as the main road, the intersection is skipped. This happens if for instance 1-2 has the largest delay.
If the delay for all 4 roads is the same:
Delays for right-hand traffic:
Right turns: delay1 Straight ahead: 2 * delay1 Left turns: 4.5 * delay1
Delays for left-hand traffic:
Left turns: delay1 Straight ahead: 2 * delay1 Right turns: 4.5 * delay1
For intersections with >4 links:
No processing occurs. You can use the events instead.
Syntax: TurnAutoProcess(index: integer; LeftHandTraffic: boolean; RCTC: TRoadClassTurnCost; SkipNodes: TBitArray)
|