r.grow(1grass)

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

okay bestie, welcome to r.grow(1grass) β€” she lives in the GRASS User's Manual and she's about to make your raster areas bigger (or smaller, we contain multitudes πŸ’…).


✨ NAME ✨

r.grow β€” makes a raster map layer where all the contiguous areas got grown by exactly one cell. iconic behaviour, no notes. πŸ¦‹


🏷️ 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]   [nprocs=integer]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags 🚩

  • -m β€” bestie, the radius is in map units now, not cells. glow different ✨
  • --overwrite β€” lets output files bulldoze whatever files already exist. use with intention, she has no chill πŸ’€
  • --help β€” prints the usage summary, aka the tl;dr 🫢
  • --verbose β€” verbose module output, she tells you everything that's happening πŸ“£
  • --quiet β€” quiet module output, she says nothing. mysterious. πŸ’œ
  • --ui β€” forces the GUI dialog to launch πŸŽ€

πŸŽ›οΈ Parameters πŸŽ›οΈ

  • input=name [required] β€” name of the input raster map. mandatory, she needs to know what we're working with πŸ’–
  • output=name [required] β€” name for the output raster map. also mandatory, we need somewhere to put the glow-up 🌸
  • radius=float β€” radius of the buffer, measured in raster cells. Default: 1.01 ✨
  • metric=string β€” the metric. Options: euclidean, maximum, manhattan. Default: euclidean πŸ“
  • old=integer β€” the value written for input cells which are non-NULL (-1 => NULL) 🧚
  • new=integer β€” the value written for the "grown" cells 🌱
  • nprocs=integer β€” number of threads for parallel computing. 0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs. Default: 0 πŸ”₯

🌈 DESCRIPTION 🌈

okay so here's the tea: r.grow adds cells around the perimeters of all the areas in a raster map layer you pick, then stashes the result in a brand-new raster map layer. she's giving contour-but-make-it-thrive.

you can use her to grow by one cell or by more than one cell β€” just vary the size of the radius parameter, iykyk. she's also like r.buffer, except with the option of preserving the original cells, which is basically combining r.buffer and r.patch into one main-character moment πŸ‘‘

and if radius is negative? r.grow shrinks areas by removing cells around the perimeters of all areas. yes she does both. versatile icon πŸ’…


πŸ“ NOTES πŸ“

you get to specify three whole different metrics, and they control the geometry of how the grown cells get created β€” all via the metric parameter: Euclidean, Manhattan, and Maximum. let's break it down bestie 🫢

πŸŒ€ Euclidean

The Euclidean distance, a.k.a. the Euclidean metric, is the "ordinary" distance between two points β€” the kind you'd measure with a ruler. It can be proven by repeated application of the Pythagorean theorem. The formula is given by:

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. so pretty. so round. β­•

πŸš• Manhattan

The Manhattan metric, a.k.a. Taxicab geometry, is a form of geometry where the usual metric of Euclidean geometry 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 causes the shortest path a car could take between two points in the city to have length equal to the points' distance in taxicab geometry. city girl behaviour fr fr πŸŒ†

The formula is given by:

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

Cells grown using this metric form isolines of distance that are rhombus-shaped from a given point. diamond vibes. πŸ’Ž

⬛ Maximum

The Maximum metric is given by the formula:

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

where the isolines of distance from a point are squares. 🟩

πŸ₯‡ tie-breaking tea

If there are two cells which 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 is chosen. north-then-west, she has a system, don't question her πŸ’…


πŸ§ͺ EXAMPLE πŸ§ͺ

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

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

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

grow one way, shrink the other, both slay 😭✨


πŸ‘€ 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)

Latest change: Wednesday Dec 17 11:22:25 2025 in commit: dad9a86c2cb7835808bebaed071d3aeb6888ea87

Main index | Raster 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 GRASS 8.5.0, footer said GRASS 8.5.0 down at the bottom, last touched Wednesday Dec 17 11:22:25 2025 in commit dad9a86c2cb7835808bebaed071d3aeb6888ea87, and the copyright is Β© 2003-2026 GRASS Development Team, from the GRASS 8.5.0 Reference Manual. go grow something gorgeous πŸŽ€πŸŒˆπŸ’–

πŸ“¦ where this page comes from