Debian Codegraph @

vector/v.net.iso/v.net.iso.html

raw
1 <h2>DESCRIPTION</h2>
2
3 <em>v.net.iso</em> splits a network into bands between cost isolines
4 (distance from center). Center nodes must be opened (costs &gt;= 0). The
5 costs of center nodes are used in the calculation.
6 <p>Costs may be either line lengths, or attributes saved in a database
7 table. These attribute values are taken as costs of whole segments, not
8 as costs to traverse a length unit (e.g. meter) of the segment.
9 For example, if the speed limit is 100 km / h, the cost to traverse a
10 10 km long road segment must be calculated as
11 <br>
12 length / speed = 10 km / (100 km/h) = 0.1 h.
13 <br>
14 Supported are cost assignments for both arcs and nodes,
15 and also different costs for both directions of a vector line.
16 For areas, costs will be calculated along boundary lines.
17 <p>
18 The input vector needs to be prepared with <em>v.net operation=connect</em>
19 in order to connect points representing center nodes to the network.
20 <p>
21 The nearest center can be determined using either costs from the
22 nearest center or costs to the nearest center with option
23 <b>method</b>.<p>
24 By default, the iso band number is used as category value for output
25 lines. With the <b>-u</b> flag, output lines become unique categories
26 and an attribute table is created with the fields <em>cat, ocat,
27 center, isonr, isolbl</em>. The <em>ocat</em> field holds the original
28 line category in <b>arc_layer</b>, the <em>center</em> field holds the
29 center category in <b>node_layer</b>, the <em>isonr</em> field holds
30 the iso band number and the <em>isolbl</em> field holds a label for the
31 isoband. Additionally, original line categories are copied from the
32 input <b>arc_layer</b> to layer 2 in the output, together with any
33 attribute table.
34 <p>
35 Application of flag <b>-t</b> enables a turntable support. This flag
36 requires additional parameters <b>turn_layer</b> and
37 <b>turn_cat_layer</b> that are otherwise ignored. The turntable allows
38 to model e.g. traffic code, where some turns may be prohibited. This
39 means that the input layer is expanded by turntable with costs of every
40 possible turn on any possible node (intersection) in both directions.
41 Turntable can be created by the <em><a href="v.net.html">v.net</a></em>
42 module. For more information about turns in the vector network analyses
43 see
44 <a href="https://grasswiki.osgeo.org/wiki/Turns_in_the_vector_network_analysis">wiki page</a>.
45
46 <h2>NOTES</h2>
47
48 Nodes and arcs can be closed using cost = -1.
49 <p>
50 Nodes must be on the isolines.
51
52 <h2>EXAMPLES</h2>
53
54 The map must contain at least one center (point) on the vector network
55 which can be patched into with <a href="v.net.html">v.net</a>.
56
57 <p>
58 Isonetwork using distance:
59 <p>
60 <img src="vnetiso.png" alt="v.net.iso example with distance" border="1">
61
62 <p>
63 Isonetwork using time:
64 <p>
65 <img src="vnetisotime.png" alt="v.net.iso example with traveling time" border="1">
66
67 <h4>Subdivision of a network using distance:</h4>
68
69 <div class="code"><pre>
70 # Spearfish
71
72 # start node:
73 echo "591280.5|4926396.0|1" | v.in.ascii in=- out=startnode
74 g.copy vect=roads,myroads
75
76 # connect point to network
77 v.net myroads points=startnode out=myroads_net op=connect thresh=200
78
79 # define iso networks using distance:
80 v.net.iso input=myroads_net output=myroads_net_iso center_cats=1-100000 costs=1000,2000,5000
81 </pre></div>
82
83 The network is divided into 4 categories:
84
85 <div class="code"><pre>
86 v.category myroads_net_iso option=report
87 # ... reports 4 categories:
88 #cat | distance from point in meters
89 #1 0 - &lt; 1000
90 #2 1000 - &lt; 2000
91 #3 2000 - &lt; 5000
92 #4 &gt;= 5000
93 </pre></div>
94
95 To display the result, run for example:
96
97 <div class="code"><pre>
98 g.region n=4928200 s=4922300 w=589200 e=596500
99 d.mon x0
100 d.vect myroads_net_iso col=blue cats=1
101 d.vect myroads_net_iso col=green cats=2
102 d.vect myroads_net_iso col=orange cats=3
103 d.vect myroads_net_iso col=magenta cats=4
104 d.vect myroads_net col=red icon=basic/triangle fcol=green size=12 layer=2
105 </pre></div>
106
107 <h4>Subdivision of a network using traveling time:</h4>
108
109 Prepare the network as above:
110 <div class="code"><pre>
111 # Spearfish
112
113 # start node:
114 echo "591280.5|4926396.0|1" | v.in.ascii in=- out=startnode
115 g.copy vect=roads,myroads
116
117 # connect point to network
118 v.net myroads points=startnode out=myroads_net op=connect thresh=200
119 </pre></div>
120
121 Define costs as traveling time dependent on speed limits:
122 <div class="code"><pre>
123 # set up costs
124
125 # create unique categories for each road in layer 3
126 v.category in=myroads_net out=myroads_net_time opt=add cat=1 layer=3 type=line
127
128 # add new table for layer 3
129 v.db.addtable myroads_net_time layer=3 col="cat integer,label varchar(43),length double precision,speed double precision,cost double precision,bcost double precision"
130
131 # copy road type to layer 3
132 v.to.db myroads_net_time layer=3 qlayer=1 opt=query qcolumn=label columns=label
133
134 # upload road length in miles
135 v.to.db myroads_net_time layer=3 type=line option=length col=length unit=miles
136
137 # set speed limits in miles / hour
138 v.db.update myroads_net_time layer=3 col=speed val="5.0"
139 v.db.update myroads_net_time layer=3 col=speed val="75.0" where="label='interstate'"
140 v.db.update myroads_net_time layer=3 col=speed val="75.0" where="label='primary highway, hard surface'"
141 v.db.update myroads_net_time layer=3 col=speed val="50.0" where="label='secondary highway, hard surface'"
142 v.db.update myroads_net_time layer=3 col=speed val="25.0" where="label='light-duty road, improved surface'"
143 v.db.update myroads_net_time layer=3 col=speed val="5.0" where="label='unimproved road'"
144
145 # define traveling costs as traveling time in minutes:
146
147 # set forward costs
148 v.db.update myroads_net_time layer=3 col=cost val="length / speed * 60"
149 # set backward costs
150 v.db.update myroads_net_time layer=3 col=bcost val="length / speed * 60"
151
152 # define iso networks using traveling time:
153 v.net.iso input=myroads_net_time output=myroads_net_iso_time arc_layer=3 node_layer=2 arc_column=cost arc_backward_column=bcost center_cats=1-100000 costs=1,2,5
154 </pre></div>
155
156 To display the result, run for example:
157
158 <div class="code"><pre>
159 # add table with labels and coloring
160 v.db.addtable myroads_net_iso_time columns="cat integer,trav_time varchar(20),GRASSRGB varchar(11)"
161 # labels
162 v.db.update map=myroads_net_iso_time layer=1 column=trav_time value="0 - 1" where="cat = 1"
163 v.db.update map=myroads_net_iso_time layer=1 column=trav_time value="1 - 2" where="cat = 2"
164 v.db.update map=myroads_net_iso_time layer=1 column=trav_time value="2 - 5" where="cat = 3"
165 v.db.update map=myroads_net_iso_time layer=1 column=trav_time value="&gt; 5" where="cat = 4"
166 # colors
167 # cats=1: blue
168 v.db.update map=myroads_net_iso_time layer=1 column=GRASSRGB value="000:000:255" where="cat = 1"
169 # cats=2: green
170 v.db.update map=myroads_net_iso_time layer=1 column=GRASSRGB value="000:255:000" where="cat = 2"
171 # cats=3: orange
172 v.db.update map=myroads_net_iso_time layer=1 column=GRASSRGB value="255:128:000" where="cat = 3"
173 # cats=4: magenta
174 v.db.update map=myroads_net_iso_time layer=1 column=GRASSRGB value="255:000:255" where="cat = 4"
175
176 # show results
177 g.region n=4928200 s=4922300 w=589200 e=596500
178 d.mon x0
179 d.vect myroads_net_iso_time layer=1 -a rgb_col=GRASSRGB
180 d.vect myroads_net col=red icon=basic/triangle fcol=green size=12 layer=2
181 </pre></div>
182
183 <h2>SEE ALSO</h2>
184
185 <em>
186 <a href="d.path.html">d.path</a>,
187 <a href="v.net.html">v.net</a>,
188 <a href="v.net.alloc.html">v.net.alloc</a>,
189 <a href="v.net.path.html">v.net.path</a>,
190 <a href="v.net.salesman.html">v.net.salesman</a>,
191 <a href="v.net.steiner.html">v.net.steiner</a>,
192 <a href="v.patch.html">v.patch</a>
193 </em>
194
195 <h2>AUTHORS</h2>
196
197 Radim Blazek, ITC-Irst, Trento, Italy<br>
198 Documentation: Markus Neteler, Markus Metz
199
200 <h3>TURNS SUPPORT</h3>
201
202 The turns support was implemnented as part of GRASS GIS turns cost project at Czech Technical University in Prague, Czech Republic.
203 Eliska Kyzlikova, Stepan Turek, Lukas Bocan and Viera Bejdova participated at the project.
204
205 Implementation: Stepan Turek
206 Documentation: Lukas Bocan
207 Mentor: Martin Landa