
NAME
v.net.allpairs - Computes the shortest path between all pairs of nodes in the network.
KEYWORDS
vector, network, shortest path
SYNOPSIS
v.net.allpairs
v.net.allpairs help
v.net.allpairs [-ga] input=name output=name [layer=integer] [cats=range] [where=sql_query] [afcolumn=name] [abcolumn=name] [--overwrite] [--verbose] [--quiet]
Flags:
- -g
- Use geodesic calculation for longitude-latitude locations
- -a
- Add points on nodes without points
- --overwrite
- Allow output files to overwrite existing files
- --verbose
- Verbose module output
- --quiet
- Quiet module output
Parameters:
- input=name
- Name of input vector map
- output=name
- Name for output vector map
- layer=integer
- Layer number
- A single vector map can be connected to multiple database tables. This number determines which table to use.
- Default: 1
- cats=range
- Category values
- Example: 1,3,7-9,13
- where=sql_query
- WHERE conditions of SQL statement without 'where' keyword
- Example: income < 1000 and inhab >= 10000
- afcolumn=name
- Name of arc forward/both direction(s) cost column
- abcolumn=name
- Name of arc backward direction cost column
DESCRIPTION
v.net.allpairs computes the shortest path between each selected
node and all other selected nodes.
If the input vector has been prepared with v.net and
v.net.allpairs should use cost columns, further preparation is
of the input vector required. In contrast to the output of v.net
and the behaviour of other v.net.* modules, v.net.allpairs
uses the same layer to read cost columns for arcs and to read node
categories. Therefore new, unique categories for points must be added
to the layer with cost columns for lines with v.category.
If abcolumn is not given then then the same costs are used for
forward and backward arcs.
NOTES
An attribute table is created and linked to layer 1. The table
contains three columns: cat, to_cat, cost.
Each entry denotes the cost of the shortest path from cat to
to_cat. If the cost is negative then no path exists. If points
are specified by cats, layer or where parameters then
the table is filled only for the selected points.
If the -a flag is set then new points are added on nodes without
nodes. These points have the largest category. Precisely, the category
value of each new point is larger than any of the old categories. Note
that these new points are not included in the output table.
EXAMPLE
Find shortest path along roads from selected archsites (Spearfish sample
dataset):
# 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 layer=2 cats=1-5 out=roads_net_all
v.db.select roads_net_all
Result in matrix form:
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
SEE ALSO
v.net.path,
v.net.distance
AUTHORS
Daniel Bundala, Google Summer of Code 2009, Student
Wolf Bergenheim, Mentor
Markus Metz
Last changed: $Date: 2012-04-14 23:53:31 -0700 (Sat, 14 Apr 2012) $
Main index - vector index - Full index
© 2003-2012 GRASS Development Team