Turns in the vector network analysis: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__TOC__


== Headline text ==
The turntable can be created by {{cmd|v.net}} module, which is one of [[vector network analysis]] modules.
{{ToModify}}
Building the turntable allows you to model e.g. traffic code, where some turns may be prohibited.
It creates a turntable with the costs for every possible turn on every possible node (intersection, crossroad) in given layer. U-turns are taken in account too.


The turntable module ('''v.net.turntable''') is one of [[vector network analysis]] modules.
[[Image:Line_graph.png|center|400px|thumb| Author: Stephan Winter]]
It creates a turntable with the costs for every possible turn on every possible node (intersection, crossroad) in given layer. U-turns are taken in account too.


For better handling, a linegraph is created. In this linegraph, every line is represented by two nodes. These nodes have positive and negative values respectively, with their absolute values identical. Every node corresponds to opposite line direction. The positive node matches the direction of line. The negative node matches the opposite direction. For better understanding, let's have a travelling subject standing on a line (road) before an intersection wanting to cross it. This line's direction is TOWARDS the intersection. Travelling from this line through the intersection means that the subject is currently standing on the POSITIVE node representation of the line. After crossing to this line from any permitted direction, the subject gets to the NEGATIVE point representation of the line.
For better handling, a linegraph is created. In this linegraph, every line is represented by two nodes. These nodes have positive and negative values respectively, with their absolute values identical. Every node corresponds to opposite line direction. The positive node matches the direction of line. The negative node matches the opposite direction. For better understanding, let's have a travelling subject standing on a line (road) before an intersection wanting to cross it. This line's direction is TOWARDS the intersection. Travelling from this line through the intersection means that the subject is currently standing on the POSITIVE node representation of the line. After crossing to this line from any permitted direction, the subject gets to the NEGATIVE point representation of the line.


These two nodes  (corresponding to the same line) are connected with two U-turns (for both directions). Every U-turn direction belongs to another intersection. U-turn from the POSITIVE node to the NEGATIVE one belongs to the intersection we are going to cross. The other U-turn belongs to the intersection at the opposite end of this line.
These two nodes  (corresponding to the same line) are connected with two U-turns (for both directions). Every U-turn direction belongs to another intersection. U-turn from the POSITIVE node to the NEGATIVE one belongs to the intersection we are going to cross. The other U-turn belongs to the intersection at the opposite end of this line.  
 
'''If features in analyzed network are changed, the turntable must  be created again (e.g. it includes v.net connect operation). '''


==Turntable description (the table itself)==
==Turntable description==


Every record in the turntable represents one turn.
Every record in the turntable represents one turn.  


'''Columns description:'''
'''Columns description:'''


* '''cat''' – category in tlayer (layer with turntable), which corresponds to both lines in turn
* '''cat''' – category in '''tlayer''' (layer with turntable), which corresponds to both lines in turn


* '''ln_from''' – unique category in tucats layer assigned to the line
* '''ln_from''' – unique category in '''tuclayer''' layer assigned to the starting line of the turn


* '''ln_to''' – unique category in tucats layer assigned to the line
* '''ln_to''' – unique category in '''tuclayer''' layer assigned to the ending line line of the turn


* '''cost''' – cost for turn in forward direction from ln_from to ln_to (integer or double)
* '''cost''' – cost for turn (integer or double), assign -1 to close the turn


* '''isec''' – point category in tucats layer, which represents the intersection, where the turn belongs
* '''isec''' – point category in '''tulayer''' layer, which represents the intersection, where the turn belongs


* '''angle''' – angle between the lines before and after the intersection (radians)
* '''angle''' – angle between the lines before and after the intersection (radians), positive -> turn to the right, negative -> turn to the left, 0 -> straight


[[Image:Turntable.png|center|600px|thumb]]
[[Image:Turntable.png|center|800px|thumb]]


Every possible turn on any possible intersection is represented by unique record (line).
Every possible turn on any possible intersection is represented by unique record (line).
Line 38: Line 41:
In the angle column for this record the value is -1.373597 radians which is roughly -80°. This perfectly makes sense since left turns have negative values and right turns have positive. The angle is measured as deviance from straight direction (which is 0°).
In the angle column for this record the value is -1.373597 radians which is roughly -80°. This perfectly makes sense since left turns have negative values and right turns have positive. The angle is measured as deviance from straight direction (which is 0°).


== Specific parameters ==
== Modules working with turntable ==
 
* {{cmd|v.net}} - creates the turntable
* {{cmd|v.net.path}}
* {{cmd|v.net.alloc}}
* {{cmd|v.net.iso}}
* {{cmd|v.net.salesman}}
 
=== Specific parameters of modules working with turntable ===
 
* '''arc_layer''' - Name or number of the arc layer that will be expanded by turntable.
 
* ''' turn_layer''' - Name or number of the layer to which the turntable will be attached.
 
* ''' turn_cat_layer''' - Name or number of the layer with unique categories for every line and point. The points are  placed on every node.
 
==WxGUI Vector Network Analysis Tool (not yet implemented)==
 
In GUI for v.net modules there is the checkbox option to “use turns”. If checked, it is required to fill these additional parameters: tlayer (layer with turntable), tuclayer (layer with unique categories for turntable). The dialog is shown below.
 
[[Image:Params_ttb.png|center|400px|thumb]]


* '''alayer''' - Name or number of the arc layer that will be expanded by turntable.
It is possible to predefine costs for default or custom angle intervals in the Global settings dialog as shown in picture below.  


* '''nlayer''' - Name or number of the node (points) layer, which will be copied into output layer. By default all points are copied.
[[Image:Global_ttb.png|center|400px|thumb]]


* '''tlayer''' - Name or number of the layer to which the turntable will be attached.
The angle, however, is only the simple one between two straight lines (from previous intersection to current node and from current intersection to the next one ignoring any original shorter polyline segments).
After the turntable is created, it is possible to customize costs explicitly for any specific turn on any given intersection (node) via the Local settings dialog.


* '''tuclayer''' - Name or number of the layer with unique categories for every line and point. The points are  placed on every node.
[[Image:Local_ttb.png|center|400px|thumb]]


===Further Reading===
==Further Reading==


[ftp://ftp.geoinfo.tuwien.ac.at/winter/winter02modeling.pdf Modeling Costs of Turns in Route Planning]
[ftp://ftp.geoinfo.tuwien.ac.at/winter/winter02modeling.pdf Modeling Costs of Turns in Route Planning]

Latest revision as of 23:46, 9 June 2020

The turntable can be created by v.net module, which is one of vector network analysis modules. Building the turntable allows you to model e.g. traffic code, where some turns may be prohibited. It creates a turntable with the costs for every possible turn on every possible node (intersection, crossroad) in given layer. U-turns are taken in account too.

Author: Stephan Winter

For better handling, a linegraph is created. In this linegraph, every line is represented by two nodes. These nodes have positive and negative values respectively, with their absolute values identical. Every node corresponds to opposite line direction. The positive node matches the direction of line. The negative node matches the opposite direction. For better understanding, let's have a travelling subject standing on a line (road) before an intersection wanting to cross it. This line's direction is TOWARDS the intersection. Travelling from this line through the intersection means that the subject is currently standing on the POSITIVE node representation of the line. After crossing to this line from any permitted direction, the subject gets to the NEGATIVE point representation of the line.

These two nodes (corresponding to the same line) are connected with two U-turns (for both directions). Every U-turn direction belongs to another intersection. U-turn from the POSITIVE node to the NEGATIVE one belongs to the intersection we are going to cross. The other U-turn belongs to the intersection at the opposite end of this line.

If features in analyzed network are changed, the turntable must be created again (e.g. it includes v.net connect operation).

Turntable description

Every record in the turntable represents one turn.

Columns description:

  • cat – category in tlayer (layer with turntable), which corresponds to both lines in turn
  • ln_from – unique category in tuclayer layer assigned to the starting line of the turn
  • ln_to – unique category in tuclayer layer assigned to the ending line line of the turn
  • cost – cost for turn (integer or double), assign -1 to close the turn
  • isec – point category in tulayer layer, which represents the intersection, where the turn belongs
  • angle – angle between the lines before and after the intersection (radians), positive -> turn to the right, negative -> turn to the left, 0 -> straight

Every possible turn on any possible intersection is represented by unique record (line). In the picture above you can see the turntable and part of vector layer with highlighted turn from the line with unique category 289 through the node (intersection) 561 to the line with unique category 234. In other words the given subject travels from intersection 564 through intersection 561 to intersection 527.

Arrows show orientation of each line. Note that in case of the line 289 the subject travels in BACKWARDS direction and therefore the In_from value is NEGATIVE (-289) while in case of the line 234 the travelling is in FORWARD direction, so the In_from value is POSITIVE (234). The category of this turn can be seen in the cat column and the value is 1817 (this kind of category is stored in tlayer). This category value belongs only to the lines with unique category values 234 and 289 (stored in tuclayer).

In the angle column for this record the value is -1.373597 radians which is roughly -80°. This perfectly makes sense since left turns have negative values and right turns have positive. The angle is measured as deviance from straight direction (which is 0°).

Modules working with turntable

Specific parameters of modules working with turntable

  • arc_layer - Name or number of the arc layer that will be expanded by turntable.
  • turn_layer - Name or number of the layer to which the turntable will be attached.
  • turn_cat_layer - Name or number of the layer with unique categories for every line and point. The points are placed on every node.

WxGUI Vector Network Analysis Tool (not yet implemented)

In GUI for v.net modules there is the checkbox option to “use turns”. If checked, it is required to fill these additional parameters: tlayer (layer with turntable), tuclayer (layer with unique categories for turntable). The dialog is shown below.

It is possible to predefine costs for default or custom angle intervals in the Global settings dialog as shown in picture below.

The angle, however, is only the simple one between two straight lines (from previous intersection to current node and from current intersection to the next one ignoring any original shorter polyline segments). After the turntable is created, it is possible to customize costs explicitly for any specific turn on any given intersection (node) via the Local settings dialog.

Further Reading

Modeling Costs of Turns in Route Planning