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
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.
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)
- Use r.reclass instead of r.recode when possible (if input
raster is integer and all reclass values are integers)
- Allow text files with different types of separators (now only
comma separated files)
See this blog post for an example.
r.reclass,
r.recode
Paulo van Breugel, paulo at ecodiv.org
SOURCE CODE
Available at:
r.recode.attr source code
(history)
Latest change: Monday Jan 30 19:52:26 2023 in commit: cac8d9d848299297977d1315b7e90cc3f7698730
Main index |
Raster index |
Topics index |
Keywords index |
Graphical index |
Full index
© 2003-2023
GRASS Development Team,
GRASS GIS 8.2.2dev Reference Manual