v.net.centrality(1grass)

โœจ v.net.centrality โœจ

okay bestie, welcome to v.net.centrality, a GRASS User's Manual moment ๐Ÿ’– this one's from GRASS 8.5.0 and honestly? it's giving network-science main character energy ๐Ÿ‘‘

๐ŸŒธ NAME ๐ŸŒธ

v.net.centrality โ€” computes degree, centrality, betweeness, closeness and eigenvector centrality measures in the network. no cap, it literally does all of that ๐Ÿ’…

๐ŸŽ€ KEYWORDS ๐ŸŽ€

vector, network, centrality measures โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

v.net.centrality
v.net.centrality --help
v.net.centrality [-ga] input=name  [arc_layer=string]
[node_layer=string]  output=name  [cats=range]   [where=sql_query]
[arc_column=name]   [arc_backward_column=name]   [node_column=string]
[degree=name]   [closeness=name]   [betweenness=name]
[eigenvector=name]   [iterations=integer]   [error=float]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

๐Ÿšฉ Flags ๐Ÿšฉ

  • -g โ€” use geodesic calculation for longitude-latitude projects ๐ŸŒ like, actual earth-curvature math, not vibes
  • -a โ€” add points on nodes โœจ
  • --overwrite โ€” let your output files overwrite existing files (be brave, or be careful, your call bestie)
  • --help โ€” print the usage summary ๐Ÿ’ฌ
  • --verbose โ€” verbose module output, aka it tells you everything ๐Ÿ‘€
  • --quiet โ€” quiet module output ๐Ÿคซ
  • --ui โ€” force launching the GUI dialog ๐Ÿ–ฅ๏ธ

๐ŸŒˆ Parameters ๐ŸŒˆ

  • input=name [required] โ€” name of input vector map. Or, plot twist, a data source for direct OGR access
  • arc_layer=string โ€” arc layer. Vector features can have category values in different layers, and this number decides which layer to use. When you're doing direct OGR access, this is the layer name instead. Default: 1
  • node_layer=string โ€” node layer. Same deal as above: different layers have different category values, this picks one. With direct OGR access, it's the layer name. Default: 2
  • output=name [required] โ€” name for output vector map ๐Ÿ’พ
  • cats=range โ€” category values. Example: 1,3,7-9,13
  • where=sql_query โ€” WHERE conditions of SQL statement without the 'where' keyword. Example: income < 1000 and population >= 10000
  • arc_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)
  • degree=name โ€” name of the degree centrality column
  • closeness=name โ€” name of the closeness centrality column
  • betweenness=name โ€” name of the betweenness centrality column
  • eigenvector=name โ€” name of the eigenvector centrality column
  • iterations=integer โ€” maximum number of iterations to compute eigenvector centrality. Default: 1000
  • error=float โ€” cumulative error tolerance for eigenvector centrality. Default: 0.1

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

v.net.centrality computes degree, closeness, betweenness and eigenvector centrality measures. that's it, that's the description, and it ate ๐Ÿ”ฅ

๐Ÿ‘‘ NOTES ๐Ÿ‘‘

so here's the tea bestie: the module computes all these centrality measures for every node and stashes them in the given columns of an attribute table, which it creates and links to the output map ๐Ÿซถ for the actual description of these measures, go check the wikipedia article it mentions, iykyk.

if you don't give a column name for a measure, that measure just doesn't get computed. simple as that ๐Ÿ’…

if the -a flag is set, points get added on nodes that don't have points. also, the points you actually compute output for can be specified with the cats, layer and where parameters. however โ€” and this is the important bit โ€” if any of those parameters is present, then the -a flag is ignored and no new points get added. periodt.

the betweenness measure is not normalised. to get normalised values (between 0 and 1), you gotta divide each number by N choose 2 = N*(N-1)/2, where N is the number of nodes in the connected component. do the math, bestie ๐Ÿงฎ

computation of the eigenvector measure stops when either the given number of iterations is reached, or the cumulative squared error between successive iterations is less than error. so it's like, it knows when to stop, iconic behaviour honestly โœจ


๐ŸŒธ EXAMPLES ๐ŸŒธ

compute closeness and betweenness centrality measures for each node, and produce a map that contains not only the points already in the input map but a map with a point on every node ๐ŸŽ€

v.net.centrality input=roads output=roads_cent closeness=closeness \
      betweenness=betweenness -a

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

v.net, v.generalize ๐Ÿ’–

๐ŸŒˆ AUTHORS ๐ŸŒˆ

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

โญ SOURCE CODE โญ

available at: v.net.centrality 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 page bestie!! ๐ŸŒˆ this was the GRASS 8.5.0 v.net.centrality(1grass) manual, dated with its latest change on Friday May 09 14:33:40 2025, ยฉ 2003-2026 GRASS Development Team โ€” go compute some centrality, you got this ๐Ÿซถ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from