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
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms