NAME
r.grow - Generates an output raster map layer
with contiguous areas grown by one cell (pixel).
(GRASS Raster Program)
SYNOPSIS
r.grow
r.grow help
r.grow [-bq] input=name
output=name
DESCRIPTION
r.grow
adds one cell around the perimeters of all areas in a user-specified raster
map layer and stores the output in a new raster map layer.
An area consists of any contiguous clump of cells with
non-zero category values. No distinction is made between
differing category values within an area. Rather, a border
is grown around the outside of each entire contiguous set
of non-zero cells.
The output raster map layer will not go outside
the boundaries set in the current geographic region. Thus,
if a contiguous area in the input raster map layer
extends to the geographic edge of the current map layer, no
new border cells can be added to that side of the area.
Growth around a rectangular area in the input raster map layer will
occur straight out from each edge, but not diagonally
from the corners of the rectangle. Thus, the "grown"
border area will contain lines along the edge of the
original rectangle, but the corners of the border will not be squared off.
Instead, the lines
of the border which go along each side of the original rectangle
will touch only at the corners of the cells at the end of each line.
OPTIONS
The user can run r.grow either interactively or non-interactively.
The program is run interactively if the user types r.grow without
specifying flag settings and parameter values on the command line.
In this case, the user will be prompted for input.
Alternately, the user can run r.grow non-interactively, by
specifying the names of an input and output map layer,
and including any desired flags, on the command line.
Flags:
- -b
- Output a binary raster map layer having only zero-one category values,
regardless of the category values in the input map layer.
In this case, all cells with a non-zero category value in the input map
layer are assigned to category 1 in the output map layer.
If the -b flag is not used, these cells will retain their original
non-zero category values. In either case, all cells
whose category value is changed from 0 during the growing
process are assigned a category value of 1 in the output map.
- -q
- Run quietly, supressing printing of information about program progress
to standard output.
Parameters:
- input=name
- Name of an existing raster map layer in the user's
current mapset search path containing areas to be "grown".
- output=name
- Name of the new raster map layer to contain program
output. This map will be binary if the user sets the -b
flag. Otherwise, input map cells having non-zero
category values will retain their original values. In
either case, all cells whose values changed during growth
will be assigned category value 1 in the output
map.
NOTES
The r.grow command can be used to represent the
boundary of one or more areas. In this case, the zero-one
(binary) output option should NOT be used. Then the
input map layer can be subtracted from the
output map layer using the
r.mapcalc command.
All original non-zero category values will be subtracted
out, leaving the boundary areas only. This resulting
zero-one boundary depiction can be displayed over other
related raster map layers using the overlay option of
d.rast.
If the resolution of the current geographic region does not
agree with the resolution of the input raster map layer,
unintended resampling of the original raster map layer may
occur. The user should be sure that the current geographic
region is set properly.
SEE ALSO
d.rast
g.region
r.mapcalc
r.poly
AUTHOR
Marjorie Larson,
U.S. Army Construction Engineering
Research Laboratory