v.net.components(1grass)
π v.net.components π
okay bestie, gather round, because today we're finding connected components in a network and honestly? it's giving graph theory main character energy β¨
This is the GRASS User's Manual page for v.net.components β it computes the strongly and weakly connected components in a network. π«Ά
π KEYWORDS π
vector, network, components
β¨ SYNOPSIS β¨
v.net.components
v.net.components --help
v.net.components [-a] input=name [arc_layer=string]
[node_layer=string] [arc_column=name] [arc_backward_column=name]
[node_column=string] output=name method=string [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π FLAGS π
-aβ Add points on nodes. like, it literally adds points. on nodes. slay π--overwriteβ Allow output files to overwrite existing files. (permission to be a little destructive, ngl π₯)--helpβ Print usage summary. your bestie when you're lost π--verboseβ Verbose module output. it will NOT stop talking and we love that for it--quietβ Quiet module output. the introvert setting π--uiβ Force launching GUI dialog. pop-up moment π¦
πΈ PARAMETERS πΈ
input=name[required] β Name of input vector map. Or data source for direct OGR access. lowkey the whole point of this module bestie πarc_layer=stringβ Arc layer. Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. Default:1. no cap βnode_layer=stringβ Node layer. Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. Default:2. yes bestie, different default, don't come for me πarc_column=nameβ Arc forward/both direction(s) cost column (number). the cost, the price, the baggage πarc_backward_column=nameβ Arc backward direction cost column (number). for when you want to go the other way in the group chat π§node_column=stringβ Node cost column (number). how much it costs to even BE a node bestie πΈoutput=name[required] β Name for output vector map. what you're manifesting πmethod=string[required] β Type of components. Options:weak,strongweak: Weakly connected componentsstrong: Strongly connected components
π DESCRIPTION π
v.net.components computes the weakly and strongly connected components in a network. that's it. that's the vibe. absolutely iconic. π₯
π NOTES π
Two nodes, u and v, are in the same strongly connected component if there are directed paths from u to v and from v to u. mutual energy fr fr π«Ά
The nodes are in the same weakly connected component if, ignoring edge directions, there is a path between them. like, we're not even checking who's pointing at whom, we just want to know if you can get there π
The type of components is specified by the method parameter. v.net.components creates a table and links it to layer 1. This table contains only two integer columns: cat and comp. just two, no bloat, minimalism queen β¨
If a point or both endpoints of a line belong to the same component then the point/line is written to the output map and appropriate information is stored in the table. π
If the -a flag is set then new points are added on the nodes without points. These points have category numbers larger than any category used in the input map. new numbers, fresh start, glow up π
One-way roads can be defined by assigning a cost of -1 to the appropriate cost column (arc_column or arc_backward_column). This affects only strongly connected components. so if your strong result is weird, check for the -1s, bestie π
Network nodes can be closed by assigning a cost of -1 to the node cost column. All nodes with a cost < 0 can not be traversed and are end points, while all nodes with a cost β₯ 0 can be traversed. This affects both weakly and strongly connected components. so it's not just a strong-component thing, it's an everyone thing β
π¦ EXAMPLES π¦
Any road network should form a single strongly connected component. Otherwise, it is impossible to travel between some places. (and nobody wants that, the vibe check would FAIL π)
v.net.components input=roads output=roads_components method=strong
π SEE ALSO π
v.netv.category
π AUTHORS π
- Daniel Bundala, Google Summer of Code 2009, Student
- Wolf Bergenheim, Mentor
- Markus Metz
π SOURCE CODE π
Available at: v.net.components source code (history)
Latest change: Friday May 09 14:33:40 2025 in commit: b356c7e108fcbeca77474c8e83ebec8f1e7b3e4a
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole manual, bestie π this was GRASS 8.5.0, documented straight from v.net.components(1grass) β go find those components, they're literally waiting for you πβ¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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