r3.to.rast(1)
π r3.to.rast β the GRASS GIS User's Manual glow-up π
okay bestie, welcome to the GRASS GIS User's Manual page for r3.to.rast π
this is the one that takes your big chunky 3D raster maps and turns them into cute little 2D raster maps. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
r3.to.rast β converts 3D raster maps to 2D raster maps π¦
πΈ KEYWORDS πΈ
raster3d, conversion, raster, voxel
π SYNOPSIS π
r3.to.rast
r3.to.rast --help
r3.to.rast [-mr] input=string output=string [type=string]
[multiply=float] [add=float] [--overwrite] [--help] [--verbose]
[--quiet] [--ui]
π§ Flags
-mβ use the 3D raster mask (if there is one, no pressure) with the input map-rβ use the same resolution as the input 3D raster map for the 2D output maps, independent of whatever the current region settings are saying rn--overwriteβ allow output files to overwrite existing files (yes, it will actually delete the old ones, she's bold)--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching GUI dialog
π Parameters
input=string[required] β 3D raster map(s) to be converted to 2D raster slicesoutput=string[required] β basename for resultant raster slice mapstype=stringβ type of raster map to be created. Storage type for resultant raster map.- Options:
CELL,FCELL,DCELL CELL: IntegerFCELL: Single precision floating pointDCELL: Double precision floating point
- Options:
multiply=floatβ value to multiply the raster values with. Coefficient a in the equationy = ax + badd=floatβ value to add to the raster values. Coefficient b in the equationy = ax + b
π¦ DESCRIPTION π¦
So basically: this module converts one 3D raster map into several 2D raster maps, and the number of them depends on the depths. If your 2D and 3D region settings are different, the 3D resolution gets adjusted to the 2D resolution β but the depths are not touched, hands off the depths bestie π ββοΈ
You can also force r3.to.rast to use the 2D resolution of the input 3D raster map for the output maps, independently from the current region settings. Iconic behaviour, honestly.
How r3.to.rast works (there's a whole diagram in the original docs, go look at it, it eats π )
β Map type conversions
The type of the resulting 2D raster maps is determined by the type of the input 3D raster β like, a 3D raster of type DCELL (double) will result in DCELL 2D rasters. But you can request a specific type for the 2D rasters using the type option. main character energy, you decide.
The type option is especially advantageous when the 3D raster map stores categories (which need to be stored as floating point numbers) and the 2D raster map should also be categorical, i.e. use integers. In that case you set the type to CELL. slay.
π Modifying the values
You can modify the values in the 3D raster map before they get stored in the 2D raster map. Scale them with the multiply option, and add a constant value with the add option. The new value is computed with this equation, no cap:
y = ax + b
where x is the original value, a is the value of the multiply option, b is the value of the add option, and y is the new value. When multiply is not provided, the value of a is 1. When add is not provided, the value of b is 0. defaults understood, periodt π
π NOTES π
Every single slice of the 3D raster map gets copied to one 2D raster map. The maps are named like output_slicenumber. Slices are counted from bottom to the top, so the bottom slice has number 1. (bottom slice is the main character, she goes first π)
The number of slices is equal to the number of depths.
π«Ά PSA bestie: to round floating point values to integers when usingtype=CELL, you should set theaddoption to0.5.
π SEE ALSO π
r3.cross.rast, r3.out.vtk, r3.out.ascii, g.region
π AUTHORS π
- SΓΆren Gebbert
- Vaclav Petras, NCSU GeoForAll Lab
π₯ SOURCE CODE π₯
Available at: r3.to.rast source code (history)
Accessed: Saturday Jan 17 05:41:17 2026
Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie, tysm for reading π this was GRASS 8.4.2 energy, brought to you by the r3.to.rast(1) manual page, accessed Saturday Jan 17 05:41:17 2026, written by SΓΆren Gebbert and Vaclav Petras of NCSU GeoForAll Lab, copyrighted Β© 2003-2025 GRASS Development Team as part of the GRASS GIS 8.4.2 Reference Manual. go convert some voxels, you ate πβ¨π¦
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms