v.net.spanningtree(1)

πŸ’– v.net.spanningtree β€” the GRASS GIS User's Manual glow-up πŸ’–

okay bestie, so this one is from the GRASS GIS User's Manual and it's called v.net.spanningtree and it's literally about finding the cheapest lil web of connections across your network. no cap. πŸ•ΈοΈβœ¨

KEYWORDS: vector, network, spanning tree


✨ SYNOPSIS ✨

v.net.spanningtree
v.net.spanningtree --help
v.net.spanningtree [-g] input=name output=name  [arc_layer=string]
[node_layer=string]   [arc_column=name]   [node_column=name]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ FLAGS πŸŽ€

  • -g β€” use geodesic calculation for longitude-latitude projects 🌍 (so like, for lat-long vibes only)
  • --overwrite β€” allow output files to overwrite existing files (it's giving "yes, i MEANT to do that" πŸ’…)
  • --help β€” print usage summary
  • --verbose β€” verbose module output (she's chatty, we love her)
  • --quiet β€” quiet module output (she's mysterious, we also love her)
  • --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 map
  • arc_layer=string β€” arc layer. so here's the tea: vector features can have category values in different layers, and this number determines which layer to use. when it's used with direct OGR access, this is the layer name instead. default: 1
  • node_layer=string β€” node layer. same situation fr fr: vector features can have category values in different layers, this number picks which layer, and with direct OGR access it's the layer name. default: 2
  • arc_column=name β€” arc forward/both direction(s) cost column (number)
  • node_column=name β€” node cost column (number)

πŸ’« DESCRIPTION πŸ’«

v.net.spanningtree finds the minimum spanning tree in a network. that's it, that's the mission. main character energy. πŸ‘‘


πŸ”₯ NOTES πŸ”₯

okay so let's actually break this down because it's lowkey iconic:

a spanning tree is a minimum cost subnetwork connecting all nodes in an undirected network β€” meaning same forward and backward costs, no picking favorites. βš–οΈ

if your network is disconnected, then the module computes the minimum spanning tree for each (weakly) connected component. so strictly speaking, v.net.spanningtree doesn't compute a spanning tree at all β€” it computes a spanning forest. yes bestie, the name is a lil misleading, we've all been there. 🌲🌲🌲

as the name suggests, a spanning tree is a tree. meaning: it contains no cycles, and if a component has N nodes then the tree has N-1 edges connecting all nodes. math ate that. βž–

Accol is used to specify the costs of the edges. the output consists of the edges in the spanning tree. periodt. πŸŽ€


🌈 EXAMPLES 🌈

find the cheapest set of pipelines connecting all nodes. slay.

v.net.spanningtree input=projected_pipelines output=spanningtree accol=cost

πŸ¦‹ SEE ALSO πŸ¦‹

  • v.net
  • v.net.steiner

πŸ‘‘ AUTHORS πŸ‘‘

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

πŸ’œ SOURCE CODE πŸ’œ

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

Accessed: Saturday Jan 17 05:41:26 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


and that's the whole page bestie, no notes, we ate and left no crumbs πŸ’…βœ¨

so yeah, this was v.net.spanningtree(1) from GRASS 8.4.2 β€” go build a forest, not just a tree, iykyk πŸŒ²πŸ«ΆπŸ’–

πŸ“¦ where this page comes from