v.net.allpairs(1)
v.net.allpairs π β¨
okay bestie, welcome to the GRASS GIS User's Manual page for v.net.allpairs(1) β she's the girl who computes the shortest path between all pairs of nodes in the network. literally all of them. no cap. π
β¨ 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 [-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]
π«Ά Flags π«Ά
-gβ use geodesic calculation for longitude-latitude projects π--overwriteβ allow output files to overwrite existing files (yes, she will absolutely clap your old files π)--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output π€«--uiβ force launching GUI dialog
π Parameters π
input=name[required] β name of input vector map. or, plot twist, a data source for direct OGR access β¨output=name[required] β name for output vector maparc_layer=stringβ arc layer. vector features can have category values in different layers, and this number determines which layer to use. when used with direct OGR access this is the layer name. default:1node_layer=stringβ node layer. same deal: vector features can have category values in different layers, and this number determines which layer to use. when used with direct OGR access this is the layer name. default:2cats=rangeβ category values. example:1,3,7-9,13where=sql_queryβ WHERE conditions of SQL statement without 'where' keyword. example:income < 1000 and population >= 10000arc_column=nameβ arc forward/both direction(s) cost column (number)arc_backward_column=nameβ arc backward direction cost column (number)node_column=stringβ node cost column (number)
π DESCRIPTION π
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. it's giving matchmaker but for nodes fr fr π§
π 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. (yes, the original page says "then then" and honestly? iconic. keeping it exactly as-is. π
)
π¦ 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 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
look at that little grid. she ate. π₯
π SEE ALSO π
v.net.path, v.net.distance
π AUTHORS π
- Daniel Bundala, Google Summer of Code 2009, Student
- Wolf Bergenheim, Mentor
- Markus Metz
π SOURCE CODE π
available at: v.net.allpairs source code (history)
accessed: Saturday Jan 17 05:41:25 2026
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay that's the whole page bestie, ily, go compute some paths πβ¨π¦ this was GRASS 8.4.2's v.net.allpairs(1) manual page β periodt. π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms