Skip to content

r.area

Calculates area of clumped areas and remove areas smaller or greater than given threshold.

r.area [-b] input=name output=name [lesser=integer] [greater=integer] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.area input=name output=name

grass.script.run_command("r.area", input, output, lesser=0, greater=-1, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.area", input="name", output="name")

Parameters

input=name [required]
    Name of cell category map, e.g., maps created with r.clump
output=name [required]
    Name of output raster with categories representing area size (in cells)
lesser=integer
    Remove areas with number of cells lower than given value (0 for none):
    Default: 0
greater=integer
    Remove areas with number of cells greater than given value (-1 for none):
    Default: -1
-b
    Binary output
--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 cell category map, e.g., maps created with r.clump
    Used as: input, raster, name
output : str, required
    Name of output raster with categories representing area size (in cells)
    Used as: output, raster, name
lesser : int, optional
    Remove areas with number of cells lower than given value (0 for none):
    Default: 0
greater : int, optional
    Remove areas with number of cells greater than given value (-1 for none):
    Default: -1
flags : str, optional
    Allowed values: b
    b
        Binary output
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

Module r.area reclassifies raster areas (created typically with r.clump) to values representing their size (in cells). Additionally, it can be used to remove areas smaller or greater than a threshold.

NOTE

If areas belonging to a certain category are not continuous every area belonging to the same category has the same area value.

SEE ALSO

r.clump, r.mapcalc, r.reclass.area

AUTHOR

Jarek Jasiewicz

SOURCE CODE

Available at: r.area source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819