GRASS logo

NAME

r.recode.attr - Recode raster using attribute table (csv file) as input.

KEYWORDS

raster, recode

SYNOPSIS

r.recode.attr
r.recode.attr --help
r.recode.attr [-a] input=name output=name rules=name [--help] [--verbose] [--quiet] [--ui]

Flags:

-a
Align the current region to the input raster map
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Input map
output=name [required]
name(s) output layer(s)
rules=name [required]
Full path to rules file
Name of input file

Table of contents

DESCRIPTION

The r.reclass.attr plugin let you reclass/recode a raster layer based on values in a csv table. The csv file should include at least two columns. The first column should correspond to (part of) the raster values. The other columns should hold the reclassification values.

For each column in the csv (comma separated text) file (except the first one) a new map will be created, replacing the raster values corresponding to the first column with those in the second (3rd, 4th, etc) column.

The user can define the names of the output map(s). If only one output name is provided and the rules file contains more than two columns, the function will create output names by appending for each recode layer the corresponding column name to the output name provided by the user.

NOTES

The script uses r.recode to allow the user to reclass integer values to floating point values. However, like r.reclass you can only convert number one to one (and not like r.recode ranges of values to one value or a new range of values)

TODO

EXAMPLES

See this blog post for an example.

SEE ALSO

r.reclass, r.recode

AUTHOR

Paulo van Breugel, paulo at ecodiv.org

SOURCE CODE

Available at: r.recode.attr source code (history)


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

© 2003-2020 GRASS Development Team, GRASS GIS 7.8.3dev Reference Manual