v.net.allpairs(1grass)

v.net.allpairs1grass

Computes the shortest path between all pairs of nodes in the network.

Usage

v.net.allpairs

v.net.allpairs --help

v.net.allpairs [-g] input=name output=name [arc_layer=string] [node_layer=string] [cats=range] [where=sql_query] [arc_column=name] [arc_backward_column=name] [node_column=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Keywords

vector, network, shortest path

Overview

v.net.allpairs 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.

Notes

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

Examples

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 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

Source code

Available at: v.net.allpairs source code (history)

Accessed: Monday Feb 24 17:51:18 2025

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Authors

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

From grass-doc 8.4.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.