1v.net(1) GRASS GIS User's Manual v.net(1)
2
3
4
6 v.net - Performs network maintenance.
7
9 vector, network, network maintenance
10
12 v.net
13 v.net --help
14 v.net [-cs] [input=name] [points=name] [output=name] opera‐
15 tion=string [arc_layer=string] [arc_type=string[,string,...]]
16 [node_layer=string] [threshold=float] [file=name]
17 [turn_layer=string] [turn_cat_layer=string] [--overwrite] [--help]
18 [--verbose] [--quiet] [--ui]
19
20 Flags:
21 -c
22 Assign unique categories to new points
23 For operation ’nodes’
24
25 -s
26 Snap points to network
27 For operation ’connect’. By default, a new line from the point to
28 the network is created.
29
30 --overwrite
31 Allow output files to overwrite existing files
32
33 --help
34 Print usage summary
35
36 --verbose
37 Verbose module output
38
39 --quiet
40 Quiet module output
41
42 --ui
43 Force launching GUI dialog
44
45 Parameters:
46 input=name
47 Name of input vector line map (arcs)
48 Required for operation ’nodes’, ’connect’, ’report’ and ’nreport’
49
50 points=name
51 Name of input vector point map (nodes)
52 Required for operation ’connect’ and ’arcs’
53
54 output=name
55 Name for output vector map
56
57 operation=string [required]
58 Operation to be performed
59 Options: nodes, connect, arcs, report, nreport, turntable
60 nodes: new point is placed on each node (line end) if doesn’t exist
61 connect: connect still unconnected points to vector network by in‐
62 serting new line(s)
63 arcs: new line is created from start point to end point
64 report: print to standard output {line_category start_point_cate‐
65 gory end_point_category}
66 nreport: print to standard output {point_category line_cate‐
67 gory[,line_category...]}
68 turntable: create turntable on vector network
69
70 arc_layer=string
71 Arc layer
72 Vector features can have category values in different layers. This
73 number determines which layer to use. When used with direct OGR ac‐
74 cess this is the layer name.
75 Default: 1
76
77 arc_type=string[,string,...]
78 Arc type
79 Input feature type
80 Options: line, boundary
81 Default: line,boundary
82
83 node_layer=string
84 Node layer
85 Vector features can have category values in different layers. This
86 number determines which layer to use. When used with direct OGR ac‐
87 cess this is the layer name.
88 Default: 2
89
90 threshold=float
91 Threshold
92 Required for operation ’connect’. Connect points in given thresh‐
93 old.
94
95 file=name
96 Name of input file
97 Required for operation ’arcs’ (’-’ for standard input)
98
99 turn_layer=string
100 Turntable layer
101 Layer where turntable will be attached. Format: layer number[/layer
102 name].Required for operation ’turntable’.
103 Default: 3
104
105 turn_cat_layer=string
106 Layer with unique categories used in turntable
107 Layer with unique categories for every line in arc_layer and point
108 on every node. The categories are used in turntable. Format: layer
109 number[/layer name]. Required for operation ’turntable’.
110 Default: 4
111
113 v.net is used for network preparation and maintenance. Its main use is
114 to create a vector network from vector lines (arcs ) and points (nodes)
115 by creating nodes from intersections in a map of vector lines (node op‐
116 erator), by connecting a vector lines map with a points map (connect
117 operator), and by creating new lines between pairs of vector points
118 (arcs operator).
119
120 A GIS network consists of topologically correct lines (arcs). That is,
121 the lines must be connected by shared vertices where real connections
122 exist. In GRASS GIS you also can add nodes to the network. These are
123 specially designated vertices used for analyzing network properties or
124 computing cost/distance measures. That is, not all vertices are treated
125 as nodes by default. Only v.net.path can use a network without nodes,
126 they are required for all the other network modules. In GRASS, net‐
127 work arcs are stored in one data layer (normally layer 1) and nodes are
128 stored in a different data layer (normally layer 2).
129
130 v.net offers two ways to add nodes to a network of arcs and one method
131 to add arcs to a set of nodes:
132
133 1 Use the connect operation to create nodes from a vector points
134 file and add these nodes to an existing vector network of arcs
135 (i.e., lines/boundaries). This is useful when the goal is to an‐
136 alyze a set of places (points) in relation to a network--for ex‐
137 ample travel costs between places. Only points within the thresh
138 (threshold) distance to a line/boundary will be connected as
139 network nodes. There are two ways to connect nodes. By default,
140 v.net will create new lines connecting each point to the closest
141 line of the network. If you use the -s flag, however, the new
142 nodes will be added on the closest line of the network at the
143 point closest to the point you wish to add. When using the con‐
144 nect operation, some lines will share the same category. In or‐
145 der to assign unique costs to each line, a new layer needs to be
146 created with
147 v.category input=yourmap option=add cat=1 step=1 layer=3 out‐
148 put=newmap
149 followed by
150 v.db.addtable map=newmap layer=3 table=tablename.
151
152 2 Create nodes and arcs from a vector line/boundary file using the
153 node operation. This is useful if you are mostly interested in
154 the network itself and thus you can use intersections of the
155 network as start and end points. Nodes will be created at all
156 intersections of two or more lines. For an arc that consists of
157 several segments connected by vertices (the typical case), only
158 the starting and ending vertices are treated as network nodes.
159
160 3 Create straight-line arcs between pairs of nodes with the arcs
161 option. This produces networks like those of airline flights be‐
162 tween airports. It is also similar to the kind of network cre‐
163 ated with social networking software, making it possible to cre‐
164 ate georeferenced social networks.
165
166 While the arcs created with v.net will retain any attribute information
167 associated with the input vector line/boundary file in data layer 1,
168 nodes created and stored in data layer 2 will not have any associated
169 attribute information.
170
171 For nodes created using the connect and arcs operations (methods 1 and
172 3 above), the nodes can be reconnected to the attribute table of the
173 input vector points file using the attribute table manager ("manage
174 layers" tab) or by running v.db.connect.
175
176 For nodes created using the nodes operation (method 2 above), it is
177 possible to create an attribute table for the new nodes in layer 2 us‐
178 ing the attribute table manager and connect it to layer 2 ("manage lay‐
179 ers" tab) or to create a table with v.db.addtable, connect it to layer
180 2 with v.db.connect, and update the new table with cat values with
181 v.to.db.
182
183 The turntable operation creates a turntable with the costs for every
184 possible turn on every possible node (intersection, crossroad) in given
185 layer (arc_layer). U-turns are taken in account too. Turntable is
186 created in turn_layer and turn_cat_layer. Building the turntable al‐
187 lows you to model e.g. traffic code, where some turns may be prohib‐
188 ited. If features in analyzed network are changed, the turntable must
189 be created again (e.g. it includes v.net connect operation). Turntable
190 name consists of output vector map name + "_turntable_" + "t" + "_" +
191 turn_layer + "_" + "tuc" + "_" + turn_cat_layer + "_" + "a" + "_" +
192 arc_layer e. g. roads_turntable_t_3_tuc_4_a_1
193
194 These modules are able to work with the turntable: v.net.alloc,
195 v.net.iso, v.net.path, v.net.salesman For more information about turns
196 in the vector network analyses see the "turns" wiki page.
197
198 Once a vector network has been created, it can be analyzed in a number
199 of powerful ways using the suite of v.net.* modules. The shortest
200 route between two nodes, following arcs, can be computed (v.net.path),
201 as can the shortest route that will pass through a set of nodes and re‐
202 turn to the starting node (v.net.salesman). Least cost routes through
203 the network can be calculated on the basis of distance only or on the
204 basis of distance weighted by an attribute associated with each arc
205 (for example, travel speed along a network segment). A network can be
206 divided into concentric zones of equal travel cost around one or more
207 nodes (v.net.iso) or subdivided so that each node is surrounded by a
208 zone in which all arcs can be reached with the same travel costs as all
209 arcs surrounding each other node (v.net.alloc). In addition to the
210 modules listed above, the GRASS vector networking suite includes numer‐
211 ous other modules for analysis of network costs and connectivity. These
212 include: v.net.allpairs, v.net.bridge, v.net.centrality, v.net.compo‐
213 nents, v.net.distance, v.net.flow, v.net.spanningtree, v.net.steiner,
214 v.net.timetable, v.net.visibility
215
217 For a vector map prepared for network analysis in GRASS, nodes are rep‐
218 resented by the grass-internal geometry type node and arcs by the geom‐
219 etry type line. If vector editing is required to modify the graph,
220 g.gui.vdigit or v.edit can be used. See also the Linear Referencing
221 System available in GRASS GIS.
222
224 The examples are North Carolina dataset based.
225
226 Create nodes globally for all line ends and intersections
227 v.net input=streets_wake output=streets_node operation=nodes
228 # verify result
229 v.category streets_node option=report
230
231 Merge in nodes from a separate map within given threshold
232 v.net input=streets_wake points=firestations out=streets_net \
233 operation=connect threshold=500
234 # verify result
235 v.category streets_net option=report
236 The nodes are stored in layer 2 unless node_layer=1 is used.
237
238 Generating network for vector point map
239 For generating network for given vector point map an input file in the
240 following format is required:
241 [category of edge] [category of start node] [category of end node]
242
243 Option 1: Save the file (e.g. "points.txt") and generate the map:
244 v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \
245 operation=arcs file=points.txt
246 # verify result
247 v.category geodetic_swwake_pts_net option=report
248
249 Option 2: Read in from command line:
250 v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \
251 operation=arcs file=- << EOF
252 1 28000 28005
253 2 27945 27958
254 3 27886 27897
255 EOF
256 # verify result
257 v.category geodetic_swwake_pts_net option=report
258
259 Generating network with turntable for vector point map
260 Following example generates a vector map with turntable:
261 v.net operation=turntable in=railroads out=railroads_ttb
262
264 g.gui.vdigit, v.edit, Vector Network Analysis Tool
265
266 v.net.alloc, v.net.allpairs, v.net.bridge, v.net.centrality,
267 v.net.components, v.net.connectivity, v.net.distance, v.net.flow,
268 v.net.iso, v.net.path, v.net.salesman, v.net.spanningtree,
269 v.net.steiner, v.net.timetable, v.net.visibility
270
272 Radim Blazek, ITC-irst, Trento, Italy
273 Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy and CTU in
274 Prague, Czech Republic (operation ’connect’ and ’arcs’)
275 Markus Metz: important fixes and improvements
276
277 TURNS SUPPORT
278 The turns support was implemnented as part of GRASS GIS turns cost
279 project at Czech Technical University in Prague, Czech Republic.
280 Eliska Kyzlikova, Stepan Turek, Lukas Bocan and Viera Bejdova partici‐
281 pated at the project. Implementation: Stepan Turek Documentation:
282 Lukas Bocan Mentor: Martin Landa
283
285 Available at: v.net source code (history)
286
287 Accessed: Saturday Jan 21 20:39:59 2023
288
289 Main index | Vector index | Topics index | Keywords index | Graphical
290 index | Full index
291
292 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
293
294
295
296GRASS 8.2.1 v.net(1)