v.net.iso.html 13.4 KB
Newer Older
xuebingbing's avatar
xuebingbing committed
1 2 3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
xuebingbing's avatar
xuebingbing committed
4
<title>v.net.iso - GRASS GIS manual</title>
xuebingbing's avatar
xuebingbing committed
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">
<div id="container">

<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
<hr class="header">

<h2>NAME</h2>
<em><b>v.net.iso</b></em>  - Splits subnets for nearest centers by cost isolines.<BR>
Splits net to bands between cost isolines (direction from center). Center node must be opened (costs >= 0). Costs of center node are used in calculation.
<h2>KEYWORDS</h2>
<a href="vector.html">vector</a>, <a href="topic_network.html">network</a>, <a href="keywords.html#cost allocation">cost allocation</a>, <a href="keywords.html#isolines">isolines</a>
<h2>SYNOPSIS</h2>
<div id="name"><b>v.net.iso</b><br></div>
<b>v.net.iso --help</b><br>
<div id="synopsis"><b>v.net.iso</b> [-<b>tgu</b>] <b>input</b>=<em>name</em> <b>output</b>=<em>name</em>  [<b>method</b>=<em>string</em>]  <b>center_cats</b>=<em>range</em> <b>costs</b>=<em>integer</em>[,<i>integer</i>,...] <b>arc_layer</b>=<em>string</em> <b>arc_type</b>=<em>string</em>[,<i>string</i>,...] <b>node_layer</b>=<em>string</em>  [<b>arc_column</b>=<em>name</em>]   [<b>arc_backward_column</b>=<em>name</em>]   [<b>node_column</b>=<em>name</em>]   [<b>turn_layer</b>=<em>string</em>]   [<b>turn_cat_layer</b>=<em>string</em>]   [--<b>overwrite</b>]  [--<b>help</b>]  [--<b>verbose</b>]  [--<b>quiet</b>]  [--<b>ui</b>] 
</div>

<div id="flags">
<h3>Flags:</h3>
<dl>
<dt><b>-t</b></dt>
<dd>Use turntable</dd>

<dt><b>-g</b></dt>
<dd>Use geodesic calculation for longitude-latitude locations</dd>

<dt><b>-u</b></dt>
<dd>Create unique categories and attribute table</dd>
<dd>Default: one category for each iso-band</dd>

<dt><b>--overwrite</b></dt>
<dd>Allow output files to overwrite existing files</dd>
<dt><b>--help</b></dt>
<dd>Print usage summary</dd>
<dt><b>--verbose</b></dt>
<dd>Verbose module output</dd>
<dt><b>--quiet</b></dt>
<dd>Quiet module output</dd>
<dt><b>--ui</b></dt>
<dd>Force launching GUI dialog</dd>
</dl>
</div>

<div id="parameters">
<h3>Parameters:</h3>
<dl>
<dt><b>input</b>=<em>name</em>&nbsp;<b>[required]</b></dt>
<dd>Name of input vector map</dd>
<dd>Or data source for direct OGR access</dd>

<dt><b>output</b>=<em>name</em>&nbsp;<b>[required]</b></dt>
<dd>Name for output vector map</dd>

<dt><b>method</b>=<em>string</em></dt>
<dd>Use costs from centers or costs to centers</dd>
<dd>Options: <em>from, to</em></dd>
<dd>Default: <em>from</em></dd>

<dt><b>center_cats</b>=<em>range</em>&nbsp;<b>[required]</b></dt>
<dd>Category values</dd>
<dd>Categories of centers (points on nodes) to which net will be allocated, layer for this categories is given by nlayer option</dd>

<dt><b>costs</b>=<em>integer[,<i>integer</i>,...]</em>&nbsp;<b>[required]</b></dt>
<dd>Costs for isolines</dd>

<dt><b>arc_layer</b>=<em>string</em>&nbsp;<b>[required]</b></dt>
<dd>Arc layer</dd>
<dd>Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.</dd>
<dd>Default: <em>1</em></dd>

<dt><b>arc_type</b>=<em>string[,<i>string</i>,...]</em>&nbsp;<b>[required]</b></dt>
<dd>Arc type</dd>
<dd>Input feature type</dd>
<dd>Options: <em>line, boundary</em></dd>
<dd>Default: <em>line,boundary</em></dd>

<dt><b>node_layer</b>=<em>string</em>&nbsp;<b>[required]</b></dt>
<dd>Node layer</dd>
<dd>Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.</dd>
<dd>Default: <em>2</em></dd>

<dt><b>arc_column</b>=<em>name</em></dt>
<dd>Arc forward/both direction(s) cost column (number)</dd>

<dt><b>arc_backward_column</b>=<em>name</em></dt>
<dd>Arc backward direction cost column (number)</dd>

<dt><b>node_column</b>=<em>name</em></dt>
<dd>Node cost column (number)</dd>

<dt><b>turn_layer</b>=<em>string</em></dt>
<dd>Layer with turntable</dd>
<dd>Relevant only with -t flag</dd>
<dd>Default: <em>3</em></dd>

<dt><b>turn_cat_layer</b>=<em>string</em></dt>
<dd>Layer with unique categories used in turntable</dd>
<dd>Relevant only with -t flag</dd>
<dd>Default: <em>4</em></dd>

</dl>
</div>
<div class="toc">
<h4 class="toc">Table of contents</h4>
<ul class="toc">
    <li class="toc"><a href="#description" class="toc">DESCRIPTION</a></li>
    <li class="toc"><a href="#notes" class="toc">NOTES</a></li>
    <li class="toc"><a href="#examples" class="toc">EXAMPLES</a></li>
    <li class="toc"><a href="#see-also" class="toc">SEE ALSO</a></li>
    <li class="toc"><a href="#author" class="toc">AUTHOR</a>
    <ul class="toc">
        <li class="toc"><a href="#turns-support" class="toc">TURNS SUPPORT</a></li>
</ul>
</div>
<h2><a name="description">DESCRIPTION</a></h2>

<em>v.net.iso</em> splits a network into bands between cost isolines 
(distance from center). Center nodes must be opened (costs &gt;= 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><a name="notes">NOTES</a></h2>

Nodes and arcs can be closed using cost = -1. 
<p>
Nodes must be on the isolines.

<h2><a name="examples">EXAMPLES</a></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 - &lt; 1000
#2       1000 - &lt; 2000
#3       2000 - &lt; 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><a name="see-also">SEE ALSO</a></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><a name="author">AUTHOR</a></h2>

Radim Blazek, ITC-Irst, Trento, Italy<br>
Documentation: Markus Neteler, Markus Metz

<h3><a name="turns-support">TURNS SUPPORT</a></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>
--><h2>SOURCE CODE</h2>
<p>Available at: <a href="https://github.com/OSGeo/grass/tree/master/vector/v.net.iso">v.net.iso source code</a> (<a href="https://github.com/OSGeo/grass/commits/master/vector/v.net.iso">history</a>)</p>
<hr class="header">
<p>
<a href="index.html">Main index</a> |
<a href="vector.html">Vector index</a> |
<a href="topics.html">Topics index</a> |
<a href="keywords.html">Keywords index</a> |
<a href="graphical_index.html">Graphical index</a> |
<a href="full_index.html">Full index</a>
</p>
<p>
xuebingbing's avatar
xuebingbing committed
345
&copy; 2003-2020
xuebingbing's avatar
xuebingbing committed
346
<a href="http://grass.osgeo.org">GRASS Development Team</a>,
xuebingbing's avatar
xuebingbing committed
347
GRASS GIS 7.8.3 Reference Manual
xuebingbing's avatar
xuebingbing committed
348 349 350 351 352
</p>

</div>
</body>
</html>