NAME

r.rescale - Rescales the range of category values in a raster map layer.
(GRASS Raster Program)

SYNOPSIS

r.rescale
r.rescale help
r.rescale [-qz] input=name [from=min,max] output=name [to=min,max] [TITLE="phrase"]

DESCRIPTION

The r.rescale program rescales the range of category values appearing in a raster map layer. A new raster map layer, and an appropriate category file and color table based upon the original raster map layer, are generated with category labels that reflect the original category values that produced each category. This command is useful for producing representations with a reduced number of categories from a raster map layer with a large range of category values (e.g., elevation). Rescaled map layers are appropriate for use in such GRASS programs as r.stats, r.report, and r.coin.

OPTIONS

r.rescale will be run non-interactively if the user specifies program arguments on the command line, using the form:

r.rescale [-qz] input=name [from=min,max] output=name [to=min,max] [TITLE="phrase"]

Alternately, the user can simply type:

r.rescale
on the command line without program arguments. In this case, the user will be prompted for parameter values using the standard GRASS user interface described in the manual entry for parser.

Flag:

-q
Run quietly, without printing messages on program progress to the user's terminal.
-z
Use zero (0) for transparency instead of NULL, that means set values outside range to zero (0) instead of NULL.

Parameters:

input=name
The name of the raster map layer whose category values are to be rescaled.
from=min,max
The input map range to be rescaled.
Default: The full range of the input map layer.
output=name
The name of the new, rescaled raster map layer.
to=min,max
The output map range (after rescaling).
Default: 1,255
TITLE="phrase"
Title for new output raster map layer.

EXAMPLE

To rescale an elevation raster map layer with category values ranging from 1090 meters to 1800 meters into the range 1-255, the following command line could be used:
r.rescale input=elevation from=1090,1800 output=elevation.255 to=1,255

NOTES

The rescaled category value range is actually unlimited, but the category value range 1 to 255 is frequently used due to limitations of color graphics monitors.

Category values that fall beyond the input range will become NULL. This allows the user to select a subset of the full category value range for rescaling if desired. This also means that the user should know the category value range for the input raster map layer. The user can request the r.rescale program to determine this range, or can obtain it using the r.describe command. If the category value range is determined using r.rescale, the input raster map layer is examined, and the minimum and maximum non-NULL category values are selected as the input range.

SEE ALSO

r.coin, r.describe, r.mapcalc, r.reclass, r.report, r.resample, r.stats, and parser

AUTHOR

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory