GRASS logo

Note: A new GRASS GIS stable version has been released: GRASS GIS 7. Go directly to the new manual page here

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. An attribute table is created and linked to layer 1 of the output map. 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 abcolumn is not given then then the same costs are used for forward and backward arcs.

Contrary to other v.net.* modules, v.net.allpairs does not allow to use arcs and nodes from separate layers. This means that you have to put both types of features into the same layer, but with distinct category numbers in order to allow accessing specific nodes only. See the example below.

NOTES

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 between schools (North Carolina sample dataset):
#check cat values in arcs layer (streets_wake here):
v.category streets_wake op=report

#take the existing cat values of the points in schools_wake and add
50000 (because the cat values in streets_wake go up to just under 50000)
v.category schools_wake out=schools op=sum cat=50000

#now link the nodes with their new categories to the arcs, with node category values in layer 1
v.net streets_wake points=schools op=connect thresh=200 out=network
nlayer=1

#then launch your analysis indicating the cat values of the points which you want to use
v.net.allpairs network cats=50000-50167 out=allpairs 

#get distance matrix
v.db.select allpairs

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-10-24 01:13:53 -0700 (Wed, 24 Oct 2012) $


Main index - vector index - Full index

© 2003-2016 GRASS Development Team