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