r.grow(1)

πŸ’– r.grow β€” bestie edition πŸ’–

okay so this is r.grow, straight outta the GRASS GIS User's Manual (that's the r.grow(1) manual, for the record πŸ“–). She's a raster module and she's here to make your areas ✨grow✨. Strap in.


🌸 NAME 🌸

r.grow β€” generates a raster map layer with contiguous areas grown by one cell. that's it, that's the whole job, and she ate πŸ’…


πŸŽ€ KEYWORDS πŸŽ€

raster, distance, proximity


✨ SYNOPSIS ✨

r.grow
r.grow --help
r.grow [-m] input=name output=name  [radius=float]   [metric=string]
[old=integer]   [new=integer]   [--overwrite]  [--help]  [--verbose]
[--quiet]  [--ui]

πŸ¦‹ FLAGS πŸ¦‹

  • -m β€” the radius is measured in map units instead of cells. not cells, bestie, actual units on the ground.
  • --overwrite β€” lets your output files just go ahead and bulldoze whatever files were already sitting there. allow output files to overwrite existing files 🫢
  • --help β€” prints the usage summary. your little cheat sheet.
  • --verbose β€” verbose module output, aka she tells you EVERYTHING that's happening. main character narration.
  • --quiet β€” quiet module output. the opposite vibe, she says nothing 😌
  • --ui β€” force launching the GUI dialog. clicky clicky time.

πŸ“ PARAMETERS πŸ“

  • input=name [required] β€” name of the input raster map. the thing you're growing. you literally cannot skip this.
  • output=name [required] β€” name for the output raster map. where the glow-up gets saved.
  • radius=float β€” radius of the buffer in raster cells. Default: 1.01. yes, one point oh one, that's not a typo, that's the default fr fr.
  • metric=string β€” the metric, aka how she measures distance. Options: euclidean, maximum, manhattan. Default: euclidean.
  • old=integer β€” value to write for input cells which are non-NULL (-1 => NULL). so like, what do the OG cells become.
  • new=integer β€” value to write for the "grown" cells. the new girls get their own label πŸ’…

🌈 DESCRIPTION 🌈

r.grow adds cells around the perimeters of all areas in a raster map layer that you pick, and stores the output in a brand-new raster map layer. iconic behaviour honestly.

you can use it to grow by one cell or by more than one cell (just vary the size of the radius parameter, easy). or you can use it like r.buffer, but with the extra option of preserving the original cells β€” think of it like combining r.buffer and r.patch and letting them cook together πŸ”₯

and here's the plot twist: if radius is negative, r.grow does the reverse and shrinks areas by removing cells around the perimeters of all areas. she can take it away just as fast as she gives it, no cap.


πŸ’€ NOTES πŸ’€

you get to pick between three different metrics that control the geometry of how the grown cells come out (controlled by the metric parameter): Euclidean, Manhattan, and Maximum. three flavours, all valid.

Euclidean β€” the Euclidean distance / Euclidean metric is the "ordinary" distance between two points, the kind you'd measure with an actual ruler, and it can be proven by repeated application of the Pythagorean theorem. the formula is:

d(dx,dy) = sqrt(dx^2 + dy^2)

cells grown using this metric form isolines of distance that are circular from a given point, with the distance given by the radius. cute circle moment β­•

Manhattan β€” the Manhattan metric, aka Taxicab geometry, is a form of geometry where the usual Euclidean metric gets replaced by a new metric in which the distance between two points is the sum of the (absolute) differences of their coordinates. the name alludes to the grid layout of most streets on the island of Manhattan, which makes the shortest path a car could take between two points in the city have a length equal to the points' distance in taxicab geometry. the formula is:

d(dx,dy) = abs(dx) + abs(dy)

and cells grown using this metric form isolines of distance that are rhombus-shaped from a given point. rhombus. say it with me. πŸ”·

Maximum β€” the Maximum metric is given by the formula:

d(dx,dy) = max(abs(dx),abs(dy))

and here the isolines of distance from a point are squares. ⬜

one little tie-breaker rule you need to know: if there are two cells that are equal candidates to grow into an empty space, r.grow will choose the northernmost candidate. and if there are multiple candidates with the same northing, the westernmost one gets chosen. she has a system and she's sticking to it.

🌟 EXAMPLE 🌟

in this example, the lakes map in the North Carolina sample dataset gets buffered:

g.region raster=lakes -p
# the lake raster map pixel resolution is 10m
r.grow input=lakes output=lakes_grown_100m radius=10

and shrinking instead of growing:

g.region raster=lakes -p
# the lake raster map pixel resolution is 10m
r.grow input=lakes output=lakes_shrunk_100m radius=-10

see that radius=-10? negative. she's shrinking. glow-down era πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

  • r.buffer
  • r.grow.distance
  • r.patch

Wikipedia Entry: Euclidean Metric Wikipedia Entry: Manhattan Metric


πŸ‘‘ AUTHORS πŸ‘‘

  • Marjorie Larson, U.S. Army Construction Engineering Research Laboratory
  • Glynn Clements

🧚 SOURCE CODE 🧚

Available at: r.grow source code (history)

Accessed: Saturday Jan 17 05:41:52 2026

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page, bestie!! πŸ’–βœ¨πŸŽ€ this is all from the GRASS GIS 8.4.2 Reference Manual β€” that's GRASS 8.4.2, the version, and the copyright line says Β© 2003-2025 GRASS Development Team. last accessed Saturday Jan 17 05:41:52 2026. k bye, go grow something πŸŒΈπŸ¦‹πŸ«Ά

πŸ“¦ where this page comes from