v.centroids(1grass)

πŸ’– v.centroids β€” the GRASS User's Manual glow-up πŸ’–

okay bestie, welcome to v.centroids(1grass) β€” this is the GRASS manual page for v.centroids, and she's here to give your closed boundaries the centroid they've been missing. no cap, it's literally the whole job.


✨ NAME ✨

v.centroids β€” adds missing centroids to closed boundaries. that's it. that's her whole personality and she ate. πŸŽ€

πŸ¦‹ 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 β€” let the output files just bulldoze whatever's already sitting there. full main character energy, but like, watch out.
  • --help β€” prints the usage summary, aka the tl;dr.
  • --verbose β€” verbose module output, she's a yapper and we love her.
  • --quiet β€” quiet module output, shhh, no thoughts head empty.
  • --ui β€” forces the GUI dialog to launch. fancy.

πŸ’œ Parameters πŸ’œ

  • input=name [required] β€” name of the input vector map. or, plot twist, a data source for direct OGR access.
  • output=name [required] β€” name for the output vector map, so she has somewhere to live.
  • option=string β€” the action to be taken. Options: add. Default: add.
  • layer=string β€” layer number or name. vector features can carry category values in different layers, and this number picks 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, a centroid is a point sitting inside a closed ring of boundaries. a vector area is defined as a composite entity β€” a whole little outfit β€” consisting of a set of closed boundaries plus a centroid. the attribute info linked to that area? yeah, that's attached to the centroid. πŸ’…

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 can both be set with optional parameters, so you fully control the numbering vibe.

multiple attributes can be linked to a single vector entity through numbered fields called layers. go read v.category for the details, because v.centroids is simply a frontend to that module. she's dressed as a whole new program but she's really just proxying. πŸ™ˆ

here's the lore though: the boundary itself is often stored without any category reference, since it can mark the border between two adjacent areas. so it would be ambiguous which feature the attribute belongs to. in some cases that boundary might, for example, represent a road between two parcels of land β€” and in this case it is entirely appropriate for the boundary to contain category information. so like, context matters bestie, boundaries can have info or not, it depends. 🌈


πŸ“ EXAMPLES πŸ“

creating 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. ✨ iconic. no notes.


🫢 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)

latest change: Friday Aug 08 09:39:19 2025 in commit: ed72c71d8580e872cd6fd345c84a15c324764465

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


okay that's the whole page, mwah πŸ’‹ quick lil sign-off from your favorite manual: this was GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, pulled straight from the GRASS 8.5.0 Reference Manual. go add some centroids, bestie, you've got this πŸ¦‹πŸ’–

πŸ“¦ where this page comes from