v.centroids(1)

πŸ’– v.centroids πŸ’–

okay bestie, welcome to the GRASS GIS User's Manual page for v.centroids β€” she's a lil vector module with main character energy and she's here to help you ✨


πŸŽ€ NAME πŸŽ€

v.centroids β€” adds missing centroids to closed boundaries. no cap, that's literally her whole job πŸ’…


πŸ”‘ KEYWORDS πŸ”‘

vector, centroid, area


✨ SYNOPSIS ✨

v.centroids
v.centroids --help
v.centroids input=name output=name  [option=string]   [layer=string]
[cat=integer]   [step=integer]   [--overwrite]  [--help]  [--verbose]
[--quiet]  [--ui]

🚩 Flags

  • --overwrite β€” allow output files to overwrite existing files. yes she will absolutely clobber them, be so fr 😭
  • --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, plot twist, a data source for direct OGR access 🫢
  • output=name [required] β€” name for output vector map
  • option=string β€” the action to be taken. Options: add. Default: add
  • layer=string β€” layer number or name. vector features can have category values in different layers, and this number determines which layer to use. when you're doing direct OGR access, this is the layer name instead. Default: 1
  • cat=integer β€” category number starting value. Default: 1
  • step=integer β€” category increment. Default: 1

πŸ“– DESCRIPTION πŸ“–

so in GRASS GIS, a centroid is a point that lives inside a closed ring of boundaries. a vector area is defined as a composite entity β€” a set of closed boundaries plus a centroid. and the attribute information that goes with that area? it's linked to the centroid, bestie. that's the whole point πŸ‘‘

the v.centroids module adds centroids to closed boundaries in the input file and assigns a category number to them. the starting value and the increment size are both yours to set with the optional parameters. slay ✨

multiple attributes can be linked to a single vector entity through numbered fields referred to as layers. go read v.category for the full lore on that, because v.centroids is literally just a frontend to that module. iykyk πŸ’…

now here's the vibe check on boundaries themselves: the boundary is often stored without any category reference at all, because it can mark the border between two adjacent areas. so if it had a category, it would be ambiguous which feature the attribute belonged to. in some cases it might, for example, represent a road between two parcels of land β€” and in that case it's entirely appropriate for the boundary to contain category information. context matters, periodt πŸ¦‹


🌈 EXAMPLES 🌈

create an area from a closed line using the North Carolina sample dataset:

v.type input=busroute11 output=busroute11_boundary from_type=line to_type=boundary
v.centroids input=busroute11_boundary output=busroute11_area

Figure: Creating area from closed line ✨


πŸ‘€ SEE ALSO πŸ‘€

  • v.category

πŸ‘‘ AUTHORS πŸ‘‘

  • module: M. Hamish Bowman, Dept. Marine Science, Otago University, New Zealand
  • help page: Trevor Wiens

πŸ’» SOURCE CODE πŸ’»

available at: v.centroids source code (history)

accessed: Saturday Jan 17 05:41:52 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!! this was GRASS 8.4.2 (GRASS 8.4.2) of the v.centroids(1) manual, and the source/version + date up top is what you're living in rn 🫢 go forth and centroid, you absolute icon πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from