Skip to content

d.to.rast

Saves the contents of the active display monitor to a raster map.

d.to.rast output=name [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

d.to.rast output=name

grass.script.run_command("d.to.rast", output, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("d.to.rast", output="name")

Parameters

output=name [required]
    Name for output raster map
--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

output : str, required
    Name for output raster map
    Used as: output, raster, name
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

d.to.rast saves the content of the currently selected monitor into a raster map. The active monitor can be selected with d.mon. d.to.rast can be run from GUI Console tab, too. This module is not sensitive to computational region settings.

EXAMPLE

We combine different raster and vector map layers to create a composite layer which can be draped over elevation in 3D view. First, we add a couple of maps to layer manager:

g.region raster=elevation
d.rast map=elevation
d.rast map=lakes
d.vect map=roadsmajor width=4
d.vect map=roadsmajor width=2 color=yellow

# create a raster map from the display
d.to.rast output=composite

Then uncheck all layers except for elevation and switch to 3D view. In Data tab, set color map to the newly created composite map.

Raster map created by d.to.rast draped over digital elevation model Figure: Raster map created by d.to.rast draped over digital elevation model.

SEE ALSO

d.out.file, d.erase, d.rast, d.vect, d.mon

AUTHOR

Anna Petrasova, NCSU GeoForAll Lab

SOURCE CODE

Available at: d.to.rast source code (history)
Latest change: Thursday Feb 20 12:48:50 2025 in commit 1633be4