| 1 |
<h2>DESCRIPTION</h2> |
| 2 |
|
| 3 |
<em>v.net</em> is used for network preparation and maintenance. Its |
| 4 |
main use is to create a vector network from vector lines (<em>arcs |
| 5 |
</em>) and points (<em>nodes</em>) by creating nodes from |
| 6 |
intersections in a map of vector lines (<em>node</em> operator), by |
| 7 |
connecting a vector lines map with a points map (<em>connect</em> |
| 8 |
operator), and by creating new lines between pairs of vector points |
| 9 |
(<em>arcs</em> operator). |
| 10 |
|
| 11 |
<p> |
| 12 |
A GIS network consists of topologically correct lines (arcs). That is, |
| 13 |
the lines must be connected by shared vertices where real connections exist. |
| 14 |
In GRASS you also can add nodes to the network. These are specially |
| 15 |
designated vertices used for analyzing network properties or computing |
| 16 |
cost/distance measures. That is, <b>not all vertices are treated as nodes by |
| 17 |
default</b>. Only <em><a href="v.net.path.html">v.net.path</a></em> can use a |
| 18 |
network without nodes, they are required for all the other network modules. |
| 19 |
In GRASS, network arcs are stored in one data layer (normally layer 1) and |
| 20 |
nodes are stored in a different data layer (normally layer 2). |
| 21 |
|
| 22 |
<p> |
| 23 |
<em>v.net</em> offers two ways to add nodes to a network of arcs and one |
| 24 |
method to add arcs to a set of nodes: |
| 25 |
|
| 26 |
<ol> |
| 27 |
<li>Use the <em>connect</em> operation to create nodes from a vector |
| 28 |
points file and add these nodes to an existing vector network of |
| 29 |
arcs (i.e., lines/boundaries). This is useful when the goal is to |
| 30 |
analyze a set of places (points) in relation to a network--for |
| 31 |
example travel costs between places. Only points within the |
| 32 |
<em>thresh</em> (threshold) distance to a line/boundary will be |
| 33 |
connected as network nodes. There are two ways to connect nodes. By |
| 34 |
default, <em>v.net</em> will create new lines connecting each point |
| 35 |
to the closest line of the network. If you use the <em>-s</em> flag, |
| 36 |
however, the new nodes will be added on the closest line of the |
| 37 |
network at the point closest to the point you wish to add. When using |
| 38 |
the <em>connect</em> operation, some lines will share the same |
| 39 |
category. In order to assign unique costs to each line, a new layer |
| 40 |
needs to be created with<br> |
| 41 |
|
| 42 |
<code>v.category input=yourmap option=add cat=1 step=1 layer=3 output=newmap</code><br> |
| 43 |
followed by<br> |
| 44 |
<code>v.db.addtable map=newmap layer=3 table=tablename</code>.</li> |
| 45 |
|
| 46 |
<li>Create nodes and arcs from a vector line/boundary file using the |
| 47 |
<em>node</em> operation. This is useful if you are mostly interested |
| 48 |
in the network itself and thus you can use intersections of the |
| 49 |
network as start and end points. Nodes will be created at all |
| 50 |
intersections of two or more lines. For an <em>arc</em> that |
| 51 |
consists of several segments connected by vertices (the typical |
| 52 |
case), only the starting and ending vertices are treated as network |
| 53 |
nodes.</li> |
| 54 |
|
| 55 |
<li>Create straight-line arcs between pairs of nodes with the |
| 56 |
<em>arcs</em> option. This produces networks like those of airline |
| 57 |
flights between airports. It is also similar to the kind of network |
| 58 |
created with social networking software, making it possible to |
| 59 |
create georeferenced social networks.</li> |
| 60 |
</ol> |
| 61 |
|
| 62 |
<p> |
| 63 |
While the arcs created with v.net will retain any attribute information |
| 64 |
associated with the input vector line/boundary file in data layer 1, nodes |
| 65 |
created and stored in data layer 2 will not have any associated attribute |
| 66 |
information. |
| 67 |
|
| 68 |
<p> |
| 69 |
For nodes created using the <em>connect</em> and <em>arcs</em> |
| 70 |
operations (methods 1 and 3 above), the nodes can be reconnected to |
| 71 |
the attribute table of the input vector points file using the |
| 72 |
attribute table manager ("manage layers" tab) or by running |
| 73 |
<em><a href="v.db.connect.html">v.db.connect</a></em>. |
| 74 |
|
| 75 |
<p> |
| 76 |
For nodes created using the <em>nodes</em> operation (method 2 |
| 77 |
above), it is possible to create an attribute table for the new |
| 78 |
nodes in layer 2 using the attribute table manager and connect it to |
| 79 |
layer 2 ("manage layers" tab) or to create a table with |
| 80 |
<em><a href="v.db.addtable.html">v.db.addtable</a></em>, |
| 81 |
connect it to layer 2 with <em><a href="v.db.connect.html">v.db.connect</a></em>, |
| 82 |
and update the new table with cat values with <em><a href="v.to.db.html">v.to.db</a></em>. |
| 83 |
|
| 84 |
<p> |
| 85 |
The <em>turntable</em> operation creates a turntable |
| 86 |
with the costs for every possible |
| 87 |
turn on every possible node (intersection, crossroad) in given layer (arc_layer). |
| 88 |
U-turns are taken in account too. |
| 89 |
Turntable is created in <b>turn_layer</b> and <b>turn_cat_layer</b>. |
| 90 |
Building the turntable allows you to model e.g. traffic code, where some turns |
| 91 |
may be prohibited. |
| 92 |
If features in analyzed network are changed, the turntable must be created again |
| 93 |
(e.g. it includes v.net connect operation). |
| 94 |
Turntable name consists of output vector map name + "_turntable_" + "t" + "_" + turn_layer + |
| 95 |
"_" + "tuc" + "_" + turn_cat_layer + "_" + "a" + "_" + arc_layer e. g. roads_turntable_t_3_tuc_4_a_1 |
| 96 |
|
| 97 |
<p>These modules are able to work with the turntable: |
| 98 |
|
| 99 |
<em> |
| 100 |
<a href="v.net.alloc.html">v.net.alloc</a>, |
| 101 |
<a href="v.net.iso.html">v.net.iso</a>, |
| 102 |
<a href="v.net.path.html">v.net.path</a>, |
| 103 |
<a href="v.net.salesman.html">v.net.salesman</a> |
| 104 |
|
| 105 |
</em> |
| 106 |
|
| 107 |
For more information about turns in the vector network analyses see the "turns" |
| 108 |
<a href="https://grasswiki.osgeo.org/wiki/Turns_in_the_vector_network_analysis">wiki page</a>. |
| 109 |
|
| 110 |
<p> |
| 111 |
Once a vector network has been created, it can be analyzed in a |
| 112 |
number of powerful ways using the suite of <em>v.net</em>.* modules. |
| 113 |
The shortest route between two nodes, following arcs, can be computed |
| 114 |
(<em><a href="v.net.path.html">v.net.path</a></em>), as can the |
| 115 |
shortest route that will pass through a set of nodes and return to the |
| 116 |
starting node (<em><a href="v.net.salesman.html">v.net.salesman</a></em>). |
| 117 |
Least cost routes through the network can be calculated on the basis of |
| 118 |
distance only or on the basis of distance weighted by an attribute |
| 119 |
associated with each arc (for example, travel speed along a network segment). |
| 120 |
A network can be divided into concentric zones of equal travel cost around |
| 121 |
one or more nodes (<em><a href="v.net.iso.html">v.net.iso</a></em>) or |
| 122 |
subdivided so that each node is surrounded by a zone in which all arcs |
| 123 |
can be reached with the same travel costs as all arcs surrounding each |
| 124 |
other node (<em><a href="v.net.alloc.html">v.net.alloc</a></em>). |
| 125 |
|
| 126 |
In addition to the modules listed above, the GRASS vector networking suite |
| 127 |
includes numerous other modules for analysis of network costs and |
| 128 |
connectivity. These include: |
| 129 |
|
| 130 |
<em> |
| 131 |
<a href="v.net.allpairs.html">v.net.allpairs</a>, |
| 132 |
<a href="v.net.bridge.html">v.net.bridge</a>, |
| 133 |
<a href="v.net.centrality.html">v.net.centrality</a>, |
| 134 |
<a href="v.net.components.html">v.net.components</a>, |
| 135 |
<a href="v.net.distance.html">v.net.distance</a>, |
| 136 |
<a href="v.net.flow.html">v.net.flow</a>, |
| 137 |
<a href="v.net.spanningtree.html">v.net.spanningtree</a>, |
| 138 |
<a href="v.net.steiner.html">v.net.steiner</a>, |
| 139 |
<a href="v.net.timetable.html">v.net.timetable</a>, |
| 140 |
<a href="v.net.visibility.html">v.net.visibility</a> |
| 141 |
</em> |
| 142 |
|
| 143 |
<h2>NOTES</h2> |
| 144 |
|
| 145 |
For a vector map prepared for network analysis in GRASS, nodes are |
| 146 |
represented by the grass-internal geometry type <em>node</em> and arcs |
| 147 |
by the geometry type <em>line</em>. |
| 148 |
|
| 149 |
If vector editing is required to modify the |
| 150 |
graph, <em><a href="g.gui.vdigit.html">g.gui.vdigit</a></em> |
| 151 |
or <em><a href="v.edit.html">v.edit</a></em> can be used. See also |
| 152 |
the <a href="lrs.html">Linear Referencing System</a> available in |
| 153 |
GRASS. |
| 154 |
|
| 155 |
<h2>EXAMPLES</h2> |
| 156 |
|
| 157 |
The examples are <a href="https://grassbook.org/datasets/datasets-3rd-edition/">North Carolina dataset</a> based. |
| 158 |
|
| 159 |
<h3>Create nodes globally for all line ends and intersections</h3> |
| 160 |
|
| 161 |
<div class="code"><pre> |
| 162 |
v.net input=streets_wake output=streets_node operation=nodes |
| 163 |
# verify result |
| 164 |
v.category streets_node option=report |
| 165 |
</pre></div> |
| 166 |
|
| 167 |
<h3>Merge in nodes from a separate map within given threshold</h3> |
| 168 |
|
| 169 |
<div class="code"><pre> |
| 170 |
v.net input=streets_wake points=firestations out=streets_net \ |
| 171 |
operation=connect threshold=500 |
| 172 |
# verify result |
| 173 |
v.category streets_net option=report |
| 174 |
</pre></div> |
| 175 |
|
| 176 |
The nodes are stored in layer 2 unless <code>node_layer=1</code> is used. |
| 177 |
|
| 178 |
<h3>Generating network for vector point map</h3> |
| 179 |
|
| 180 |
For generating network for given vector point map an input file in the |
| 181 |
following format is required: |
| 182 |
|
| 183 |
<div class="code"><pre> |
| 184 |
[category of edge] [category of start node] [category of end node] |
| 185 |
</pre></div> |
| 186 |
|
| 187 |
<p> |
| 188 |
Option 1: Save the file (e.g. "points.txt") and generate the map: |
| 189 |
<div class="code"><pre> |
| 190 |
v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \ |
| 191 |
operation=arcs file=points.txt |
| 192 |
# verify result |
| 193 |
v.category geodetic_swwake_pts_net option=report |
| 194 |
</pre></div> |
| 195 |
|
| 196 |
<p> |
| 197 |
Option 2: Read in from command line: |
| 198 |
<div class="code"><pre> |
| 199 |
v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \ |
| 200 |
operation=arcs file=- << EOF |
| 201 |
1 28000 28005 |
| 202 |
2 27945 27958 |
| 203 |
3 27886 27897 |
| 204 |
EOF |
| 205 |
|
| 206 |
# verify result |
| 207 |
v.category geodetic_swwake_pts_net option=report |
| 208 |
</pre></div> |
| 209 |
|
| 210 |
<h3>Generating network with turntable for vector point map</h3> |
| 211 |
|
| 212 |
Following example generates a vector map with turntable: |
| 213 |
<div class="code"><pre> |
| 214 |
v.net operation=turntable in=railroads out=railroads_ttb |
| 215 |
</pre></div> |
| 216 |
|
| 217 |
<h2>SEE ALSO</h2> |
| 218 |
|
| 219 |
<em> |
| 220 |
<a href="g.gui.vdigit.html">g.gui.vdigit</a>, |
| 221 |
<a href="v.edit.html">v.edit</a>, |
| 222 |
<a href="wxGUI.vnet.html">Vector Network Analysis Tool</a> |
| 223 |
</em> |
| 224 |
|
| 225 |
<p> |
| 226 |
<em> |
| 227 |
<a href="v.net.alloc.html">v.net.alloc</a>, |
| 228 |
<a href="v.net.allpairs.html">v.net.allpairs</a>, |
| 229 |
<a href="v.net.bridge.html">v.net.bridge</a>, |
| 230 |
<a href="v.net.centrality.html">v.net.centrality</a>, |
| 231 |
<a href="v.net.components.html">v.net.components</a>, |
| 232 |
<a href="v.net.connectivity.html">v.net.connectivity</a>, |
| 233 |
<a href="v.net.distance.html">v.net.distance</a>, |
| 234 |
<a href="v.net.flow.html">v.net.flow</a>, |
| 235 |
<a href="v.net.iso.html">v.net.iso</a>, |
| 236 |
<a href="v.net.path.html">v.net.path</a>, |
| 237 |
<a href="v.net.salesman.html">v.net.salesman</a>, |
| 238 |
<a href="v.net.spanningtree.html">v.net.spanningtree</a>, |
| 239 |
<a href="v.net.steiner.html">v.net.steiner</a>, |
| 240 |
<a href="v.net.timetable.html">v.net.timetable</a>, |
| 241 |
<a href="v.net.visibility.html">v.net.visibility</a> |
| 242 |
</em> |
| 243 |
|
| 244 |
<h2>AUTHORS</h2> |
| 245 |
|
| 246 |
Radim Blazek, ITC-irst, Trento, Italy<br> |
| 247 |
|
| 248 |
Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy and CTU in |
| 249 |
Prague, Czech Republic (operation 'connect' and 'arcs')<br> |
| 250 |
|
| 251 |
Markus Metz: important fixes and improvements |
| 252 |
|
| 253 |
<h3>TURNS SUPPORT</h3> |
| 254 |
|
| 255 |
The turns support was implemnented as part of GRASS GIS turns cost project at Czech Technical University in Prague, Czech Republic. |
| 256 |
Eliska Kyzlikova, Stepan Turek, Lukas Bocan and Viera Bejdova participated at the project. |
| 257 |
|
| 258 |
Implementation: Stepan Turek |
| 259 |
Documentation: Lukas Bocan |
| 260 |
Mentor: Martin Landa |