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, strong
    • weak: Weakly connected components
    • strong: 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.net
  • v.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