Skip to content

d.rast

Displays user-specified raster map in the active graphics frame.

d.rast [-ni] map=name [values=value[-value] [,value[-value],...]] [bgcolor=color] [--verbose] [--quiet] [--qq] [--ui]

Example:

d.rast map=name

grass.script.run_command("d.rast", map, values=None, bgcolor="white", flags=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("d.rast", map="name")

grass.tools.Tools.d_rast(map, values=None, bgcolor="white", flags=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.d_rast(map="name")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

Parameters

map=name [required]
    Name of raster map to be displayed
values=value[-value] [,value[-value],...]
    List of categories or values to be displayed
bgcolor=color
    Background color (for null)
    Either a standard color name or R:G:B triplet
    Default: white
-n
    Make null cells opaque
-i
    Invert value list
--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 to be displayed
    Used as: input, raster, name
values : str | list[str], optional
    List of categories or values to be displayed
    Used as: value[-value]
bgcolor : str, optional
    Background color (for null)
    Either a standard color name or R:G:B triplet
    Used as: input, color, color
    Default: white
flags : str, optional
    Allowed values: n, i
    n
        Make null cells opaque
    i
        Invert value list
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

map : str | np.ndarray, required
    Name of raster map to be displayed
    Used as: input, raster, name
values : str | list[str], optional
    List of categories or values to be displayed
    Used as: value[-value]
bgcolor : str, optional
    Background color (for null)
    Either a standard color name or R:G:B triplet
    Used as: input, color, color
    Default: white
flags : str, optional
    Allowed values: n, i
    n
        Make null cells opaque
    i
        Invert value list
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.

DESCRIPTION

d.rast displays the specified raster map in the active display frame on the graphics monitor.

EXAMPLE

Display raster map "elevation":

d.rast map=elevation

d.rast elevation
Figure: elevation raster map visualization

Display raster map "elevation" but only the raster cells with values between 75 and 80 meters:

d.rast map=elevation values=75-80

d.rast elevation with values
Figure: elevation raster map showing values between 75 and 80 meters

Display raster map "landuse96_28m" but only categories 1 and 2:

d.rast landuse96_28m values=1,2

d.rast landuse
Figure: landuse raster map showing categories 1 and 2

SEE ALSO

d.rast.arrow, d.rast.num, d.rast.leg, d.legend, d.mon, d.erase, d.vect

wxGUI

AUTHOR

James Westervelt, U.S. Army Construction Engineering Research Laboratory

SOURCE CODE

Available at: d.rast source code (history)
Latest change: Wednesday Feb 12 23:02:46 2025 in commit 9c11460