Skip to content

r.describe

Prints terse list of category values found in a raster map layer.

r.describe [-1rndi] map=name [null_value=string] [nsteps=integer] format=name [--verbose] [--quiet] [--qq] [--ui]

Example:

r.describe map=name format=plain

grass.script.parse_command("r.describe", map, null_value="*", nsteps=255, format="plain", flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.parse_command("r.describe", map="name", format="json")

Parameters

map=name [required]
    Name of raster map
null_value=string
    String representing NULL value
    Default: *
nsteps=integer
    Number of quantization steps
    Default: 255
format=name [required]
    Output format
    Allowed values: plain, json
    Default: plain
    plain: Plain text output
    json: JSON (JavaScript Object Notation)
-1
    Print the output one value per line
-r
    Only print the range of the data
-n
    Suppress reporting of any NULLs
-d
    Use the current region
-i
    Read floating-point map as integer
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

map : str, required
    Name of raster map
    Used as: input, raster, name
null_value : str, optional
    String representing NULL value
    Used as: string
    Default: *
nsteps : int, optional
    Number of quantization steps
    Default: 255
format : str, required
    Output format
    Used as: name
    Allowed values: plain, json
    plain: Plain text output
    json: JSON (JavaScript Object Notation)
    Default: plain
flags : str, optional
    Allowed values: 1, r, n, d, i
    1
        Print the output one value per line
    r
        Only print the range of the data
    n
        Suppress reporting of any NULLs
    d
        Use the current region
    i
        Read floating-point map as integer
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.describe prints a terse listing of category values found in a user-specified raster map layer.

r.describe ignores the current geographic region and mask, and reads the full extent of the input raster map. This functionality is useful if the user intends to reclassify or rescale the data, since these functions (r.reclass and r.rescale) also ignore the current geographic region and mask.

The nv parameter sets the string to be used to represent NULL values in the module output; the default is '*'.

The nsteps parameter sets the number of quantisation steps to divide into the input raster map.

NOTES

FLAGS

If the user selects the -r flag, a range of category values found in the raster map layer will be printed. The range is divided into three groups: negative, positive, and zero. If negative values occur, the minimum and maximum negative values will be printed. If positive values occur, the minimum and maximum positive values will be printed. If zero occurs, this will be indicated. The range report will generally run faster than the full list (the default output).

The -d flag can be used to force r.describe to respect the current region extents when reporting raster map categories. The default behavior is to read the full extent of the input raster map.

If the -1 flag is specified, the output appears with one category value/range per line.

The -n flag suppresses the reporting of NULL values.

EXAMPLES

The following examples are from the Spearfish60 sample dataset:

r.describe landcover.30m
* 11 21-23 31 32 41-43 51 71 81-83 85 91 92
r.describe -r landcover.30m
11 thru 92
*
r.describe -n landcover.30m
11 21-23 31 32 41-43 51 71 81-83 85 91 92
r.describe -1 geology

*
1
2
3
4
5
6
7
8
9

SEE ALSO

g.region, r.mask, r.reclass, r.report, r.rescale, r.stats, r.univar

AUTHOR

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

SOURCE CODE

Available at: r.describe source code (history)
Latest change: Friday Mar 07 07:39:48 2025 in commit e1e37d8