v.net.allpairs.html 6.02 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.allpairs - 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
<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.allpairs</b></em>  - Computes the shortest path between all pairs of nodes in the network.
<h2>KEYWORDS</h2>
<a href="vector.html">vector</a>, <a href="topic_network.html">network</a>, <a href="keywords.html#shortest path">shortest path</a>
<h2>SYNOPSIS</h2>
<div id="name"><b>v.net.allpairs</b><br></div>
<b>v.net.allpairs --help</b><br>
<div id="synopsis"><b>v.net.allpairs</b> [-<b>g</b>] <b>input</b>=<em>name</em> <b>output</b>=<em>name</em>  [<b>arc_layer</b>=<em>string</em>]   [<b>node_layer</b>=<em>string</em>]   [<b>cats</b>=<em>range</em>]   [<b>where</b>=<em>sql_query</em>]   [<b>arc_column</b>=<em>name</em>]   [<b>arc_backward_column</b>=<em>name</em>]   [<b>node_column</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>-g</b></dt>
<dd>Use geodesic calculation for longitude-latitude locations</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>arc_layer</b>=<em>string</em></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>node_layer</b>=<em>string</em></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>cats</b>=<em>range</em></dt>
<dd>Category values</dd>
<dd>Example: 1,3,7-9,13</dd>

<dt><b>where</b>=<em>sql_query</em></dt>
<dd>WHERE conditions of SQL statement without 'where' keyword</dd>
<dd>Example: income &lt; 1000 and population &gt;= 10000</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>string</em></dt>
<dd>Node cost column (number)</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="#example" class="toc">EXAMPLE</a></li>
    <li class="toc"><a href="#see-also" class="toc">SEE ALSO</a></li>
    <li class="toc"><a href="#authors" class="toc">AUTHORS</a></li>
</ul>
</div>
<h2><a name="description">DESCRIPTION</a></h2>

<em>v.net.allpairs</em> computes the shortest path between each selected 
node and all other selected nodes. The output is a vector with the 
selected nodes and the shortest paths. 

<h2><a name="notes">NOTES</a></h2>

An attribute table is created and linked to layer <em>arc_layer</em>. The 
table contains four columns: <em>cat</em>, <em>from_cat</em>, 
<em>to_cat</em>, <em>cost</em>. 
Each <em>cat</em> entry denotes the category of the shortest path from 
the node with category <em>from_cat</em> to the node with category 
<em>to_cat</em>. If points are specified by <b>cats, layer</b> or 
<b>where</b> parameters then the table is filled only for the selected 
points.
<br>
If <b>arc_backward_column</b> is not given then then the same costs are used for 
forward and backward arcs.

<h2><a name="example">EXAMPLE</a></h2>

Find shortest path along roads from selected archsites (Spearfish sample 
dataset):
<div class="code"><pre>
# prepare network: connect archsites to roads with threshold 200
v.net input=roads@PERMANENT points=archsites@PERMANENT \
output=roads_net operation=connect thresh=200

# verify result
v.category input=roads_net option=report

# only lines should have a category in layer 1
# only points should have a category in layer 2

# shortest path between all points with categories 1 - 5 in layer 2
v.net.allpairs input=roads_net cats=1-5 out=roads_net_all
v.db.select roads_net_all
</pre></div>

Result in matrix form:
<div class="code"><pre>
from\to	1		3		4		5
1	0		18820.386	17206.651	17373.274
3	18820.386	0		1739.079	9040.575
4	17206.651	1739.079	0		7426.84
5	17373.274	9040.575	7426.84		0
</pre></div>

<h2><a name="see-also">SEE ALSO</a></h2>

<em>
<a href="v.net.path">v.net.path</a>,
<a href="v.net.distance">v.net.distance</a>
</em>


<h2><a name="authors">AUTHORS</a></h2>

Daniel Bundala, Google Summer of Code 2009, Student<br>
Wolf Bergenheim, Mentor<br>
Markus Metz

<!--
<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.allpairs">v.net.allpairs source code</a> (<a href="https://github.com/OSGeo/grass/commits/master/vector/v.net.allpairs">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
170
&copy; 2003-2020
xuebingbing's avatar
xuebingbing committed
171
<a href="http://grass.osgeo.org">GRASS Development Team</a>,
xuebingbing's avatar
xuebingbing committed
172
GRASS GIS 7.8.5 Reference Manual
xuebingbing's avatar
xuebingbing committed
173 174 175 176 177
</p>

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