Skip to content

r.null.all

Manages NULL values of raster maps in a mapset or their subset.

r.null.all [-fincrzd] [setnull=val[-val] [,val[-val],...]] [null=float] [pattern=expression [,expression,...]] [exclude=string [,string,...]] [matching=string] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.null.all setnull=val[-val]

grass.script.run_command("r.null.all", setnull=None, null=None, pattern=None, exclude=None, matching="all", flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.null.all", setnull="val[-val]")

Parameters

setnull=val[-val] [,val[-val],...]
    List of cell values to be set to NULL
null=float
    The value to replace the null value by
pattern=expression [,expression,...]
    Map name search pattern (default: all)
exclude=string [,string,...]
    Map name exclusion pattern (default: none)
matching=string
    Search pattern syntax
    Allowed values: all, wildcards, basic, extended
    Default: all
    all: Match all (no pattern needed)
    wildcards: Use wildcards (glob pattern)
    basic: Use basic regular expressions
    extended: Use extended regular expressions
-f
    Only do the work if the map is floating-point
-i
    Only do the work if the map is integer
-n
    Only do the work if the map doesn't have a NULL-value bitmap file
-c
    Create NULL-value bitmap file validating all data cells
-r
    Remove NULL-value bitmap file
-z
    Re-create NULL-value bitmap file (to compress or uncompress)
-d
    Dry run
    Map names to be checked or processed will be printed (does not take into account other flags)
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

setnull : str | list[str], optional
    List of cell values to be set to NULL
    Used as: val[-val]
null : float, optional
    The value to replace the null value by
pattern : str | list[str], optional
    Map name search pattern (default: all)
    Used as: expression
exclude : str | list[str], optional
    Map name exclusion pattern (default: none)
matching : str, optional
    Search pattern syntax
    Allowed values: all, wildcards, basic, extended
    all: Match all (no pattern needed)
    wildcards: Use wildcards (glob pattern)
    basic: Use basic regular expressions
    extended: Use extended regular expressions
    Default: all
flags : str, optional
    Allowed values: f, i, n, c, r, z, d
    f
        Only do the work if the map is floating-point
    i
        Only do the work if the map is integer
    n
        Only do the work if the map doesn't have a NULL-value bitmap file
    c
        Create NULL-value bitmap file validating all data cells
    r
        Remove NULL-value bitmap file
    z
        Re-create NULL-value bitmap file (to compress or uncompress)
    d
        Dry run
        Map names to be checked or processed will be printed (does not take into account other flags)
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.null.all manages NULL (no-data) values in all raster maps in the current mapset. Selection can be modified using pattern and exclude options. The option matching specifies the type of search pattern use. Python users will find the extended regular expression syntax (marked as extended) as most familiar, while Bash users may want to use wildcards (glob patterns).

EXAMPLES

All the following examples are using the -d flag to run in a dry run mode so that no maps are actually modified. Set all values 1 to NULL in all raster maps in the current mapset:

r.null.all setnull=1 -d

Change all NULL to zero in all raster maps in the current mapset which begin with letter t and their name contains at least one other character (using the extended regular expressions):

r.null.all null=0 pattern="^t.+" matching=extended -d

Set all values 0 to NULL in raster maps in the current mapset which do not end with the digit 1 (using the wildcards syntax):

r.null.all setnull=0 exclude="*1" matching=wildcards -d

Set all values 0 to NULL in raster maps in the current mapset which do not end with the digit 1 (using extended regular expressions):

r.null.all setnull=0 exclude=".*1" matching=extended -d

SEE ALSO

r.null, g.proj.all, g.copyall, g.rename.many

AUTHOR

Vaclav Petras, NCSU GeoForAll Lab

SOURCE CODE

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