Skip to content

r.quant

Produces the quantization file for a floating-point map.

r.quant [-tr] input=string [,string,...] [rules=name] [basemap=string] [fprange=dmin,dmax] [range=min,max] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.quant input=string

grass.script.run_command("r.quant", input, rules=None, basemap=None, fprange=None, range=None, flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.quant", input="string")

Parameters

input=string [,string,...] [required]
    Raster map(s) to be quantized
rules=name
    Path to rules file ("-" to read from stdin)
basemap=string
    Base map to take quant rules from
fprange=dmin,dmax
    Floating point range: dmin,dmax
range=min,max
    Integer range: min,max
-t
    Truncate floating point data
-r
    Round floating point data
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str | list[str], required
    Raster map(s) to be quantized
    Used as: input, raster
rules : str, optional
    Path to rules file ("-" to read from stdin)
    Used as: input, file, name
basemap : str, optional
    Base map to take quant rules from
    Used as: input, raster
fprange : tuple[str, str] | list[str] | str, optional
    Floating point range: dmin,dmax
    Used as: dmin,dmax
range : tuple[str, str] | list[str] | str, optional
    Integer range: min,max
    Used as: min,max
flags : str, optional
    Allowed values: t, r
    t
        Truncate floating point data
    r
        Round floating point data
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.quant produces the quantization file for a floating-point map.

The map parameter defines the map for which the rules are to be created. If more than one map is specified, then this implies that the floating-point range is the minimum and maximum of all the maps together, unless either basemap=map or fprange=min,max is specified.

Quant rules

The quant rules have to be entered interactively.

If rules is specified, the input has the form:

value1:value2:cat1:[cat2]

where value1 and value2 are floating point values and cat1 and cat2 are integers. If cat2 is missing, it is taken to be equal to cat1. All values can be "*" which means infinity.

NOTE

It is an error to specify both basemap and fprange.

SEE ALSO

r.support, r.null

AUTHORS

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

SOURCE CODE

Available at: r.quant source code (history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f