Skip to content

r.reclass.area

Reclasses a raster map greater or less than user specified area size (in hectares).

r.reclass.area [-cd] input=name output=name value=float mode=string [method=string] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.reclass.area input=name output=name value=float mode=string

grass.script.run_command("r.reclass.area", input, output, value, mode, method="reclass", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.reclass.area", input="name", output="name", value=float, mode="string")

Parameters

input=name [required]
    Name of input raster map
output=name [required]
    Name for output raster map
value=float [required]
    Value option that sets the area size limit (in hectares)
mode=string [required]
    Lesser or greater than specified value
    Allowed values: lesser, greater
method=string
    Method used for reclassification
    Allowed values: reclass, rmarea
    Default: reclass
-c
    Input map is clumped
-d
    Clumps including diagonal neighbors
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of input raster map
    Used as: input, raster, name
output : str, required
    Name for output raster map
    Used as: output, raster, name
value : float, required
    Value option that sets the area size limit (in hectares)
mode : str, required
    Lesser or greater than specified value
    Allowed values: lesser, greater
method : str, optional
    Method used for reclassification
    Allowed values: reclass, rmarea
    Default: reclass
flags : str, optional
    Allowed values: c, d
    c
        Input map is clumped
    d
        Clumps including diagonal neighbors
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

r.reclass.area reclasses a raster map greater or less than a user specified area size (in hectares).

If the -c flag is used, r.reclass.area will skip the creation of a clumped raster and assume that the input raster is already clumped.

EXAMPLES

In this example, the ZIP code map in the North Carolina sample dataset is filtered for large areas (removing smaller areas from the map).

g.region raster=zipcodes -p
r.report zipcodes unit=h

Extract only areas greater than 2000 ha, NULL otherwise:

r.reclass.area input=zipcodes output=zipcodes_larger2000ha mode=greater value=2000

r.report zipcodes_larger2000ha unit=h

Figure: r.reclass.area method=reclass
Figure: r.reclass.area method=reclass

In this example, the ZIP code map in the North Carolina sample dataset is filtered for smaller areas which are substituted with the value of the respective adjacent area with largest shared boundary. Reclass by substitutional removing of areas minor of 1000 ha:

r.reclass.area input=zipcodes output=zipcodes_minor1000ha mode=lesser value=1000 method=rmarea

Figure: r.reclass.area method=rmarea
Figure: r.reclass.area method=rmarea

SEE ALSO

r.reclass, r.clump, r.stats

AUTHORS

NRCS,
Markus Neteler

SOURCE CODE

Available at: r.reclass.area source code (history)
Latest change: Tuesday Feb 18 17:20:26 2025 in commit 688e625