v.net.centrality(1)

โœจ v.net.centrality โ€” the GRASS GIS User's Manual glow-up โœจ

okay bestie, welcome to v.net.centrality ๐Ÿ’… this is the page from the GRASS GIS User's Manual, section 1, and it's literally about finding out who's the main character of your network. let's get into it ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

v.net.centrality โ€” computes degree, centrality, betweeness, closeness and eigenvector centrality measures in the network.

(yes, "betweeness" is spelled exactly like that in the original, and no we are not fixing it, it's iconic ๐Ÿ’–)


๐ŸŽ€ 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
  • -a โ€” Add points on nodes
  • --overwrite โ€” Allow output files to overwrite existing 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 data source for direct OGR access.
  • 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
  • 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
  • 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 '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 degree centrality column
  • closeness=name โ€” Name of closeness centrality column
  • betweenness=name โ€” Name of betweenness centrality column
  • eigenvector=name โ€” Name of 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 the whole vibe. it does the math, you get the clout scores ๐Ÿ“Š


๐Ÿ‘‘ NOTES ๐Ÿ‘‘

so here's the tea, bestie: the module computes various centrality measures for each node and stores them in the given columns of an attribute table, which is created and linked to the output map. for the description of these, please check the following wikipedia article. ๐Ÿ’ซ

if the column name is not given for a measure, then that measure is not computed. no name, no fame. periodt.

if the -a flag is set then points are added on nodes without points. also, the points for which the output is computed can be specified by cats, layer and where parameters. however, if any of these parameters is present then the -a flag is ignored and no new points are added. ๐Ÿšจ (yes, ignored. the flag just sits there. embarrassing for it honestly.)

Betweenness measure is not normalised. in order to get the normalised values (between 0 and 1), each number needs to be divided by N choose 2 = N*(N-1)/2 where N is the number of nodes in the connected component. do your little division, queen ๐Ÿงฎ

Computation of eigenvector measure terminates if the given number of iterations is reached or the cumulative squared error between the successive iterations is less than error. so it stops when it's done or when it's good enough โ€” whichever comes first ๐Ÿ˜Œ


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Compute closeness and betweenness centrality measures for each node and produce a map containing not only points already present in the input map but a map with point on every node.

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

look at that. roads in, roads_cent out, and a point on literally every node because of that -a. slay โœจ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

v.net, v.generalize


๐Ÿ’œ AUTHORS ๐Ÿ’œ

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

shoutout to the 2009 GSoC girlies and their mentor, absolute legends ๐Ÿซถ


โญ SOURCE CODE โญ

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

Accessed: Saturday Jan 17 05:41:26 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page!! ๐ŸŽ€ this was the v.net.centrality(1) page from the GRASS GIS User's Manual, running on GRASS 8.4.2, with the reference manual dated ยฉ 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual, and the source code last accessed Saturday Jan 17 05:41:26 2026. go compute some centrality, bestie, you got this ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from