r3.to.rast(1grass)
β¨ r3.to.rast β the manual, but make it a group chat β¨
okay so bestie, this is the manual page for r3.to.rast, a GRASS tool that turns your 3D raster maps into 2D raster maps. yes literally. it's giving dimension downgrade but make it cute. π
π 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 one exists) together with the input map-rβ use the exact same resolution as the input 3D raster map for the 2D output maps, no matter what the current region settings say (independent, main character energy π«)--overwriteβ allow output files to overwrite files that already exist--helpβ print the usage summary--verboseβ verbose module output (it will not shut up, and honestly, we love that)--quietβ quiet module output--uiβ force launching the GUI dialog
πΈ Parameters πΈ
input=string[required] β 3D raster map(s) to be converted into 2D raster slicesoutput=string[required] β basename for the resultant raster slice mapstype=stringβ type of raster map to be created; also described as the storage type for the 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; it's coefficient a in the equation y = ax + badd=floatβ value to add to the raster values; it's coefficient b in the equation y = ax + b
π DESCRIPTION π
So what it does: it converts one 3D raster map into several 2D raster maps (how many depends on the depths). π«Ά
Here's the tea on regions: if the 2D and 3D region settings are different, the 3D resolution gets adjusted to the 2D resolution β but heads up, the depths are not touched. not even a little. π
And if you're feeling spicy, the user can 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.
"How r3.to.rast works" β
π§ Map type conversions π§
The type of the resulting 2D raster maps is determined by the type of the input 3D raster. so like, a 3D raster of type DCELL (double) will result in DCELL 2D rasters. no surprises there, periodt.
But you can request a specific type for the 2D rasters with the type option. π
The type option is especially advantageous when the 3D raster map stores categories (which need to be stored as floating point numbers, awkward) 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 π
The values in the 3D raster map can be modified before they get stored in the 2D raster map. You can scale the values with the multiply option, and you can add a constant value with the add option. The new value gets computed with this equation:
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. math ate that fr fr β¨
π NOTES π
Every 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. counting starts at one, we love a humble beginning π
The number of slices is equal to the number of depths.
And listen β to round floating point values to integers when using type=CELL, the add option should be set to 0.5. that's the hack, iykyk. π
π 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)
Latest change: Saturday Oct 11 04:38:40 2025 in commit: 3dd71f5fab83b72a2db2da959fe075c5b3b52200
Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole vibe check, bestie πΈ the manual we just devoured is from GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β and the footer says r3.to.rast(1grass) in case you need to cite it at a party. mwah π bye pookie, go convert some voxels π¦
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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