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 slices
  • output=string [required] β€” basename for resultant raster slice maps
  • type=string β€” type of raster map to be created. Storage type for resultant raster map.
    • Options: CELL, FCELL, DCELL
    • CELL: Integer
    • FCELL: Single precision floating point
    • DCELL: Double precision floating point
  • multiply=float β€” value to multiply the raster values with. Coefficient a in the equation y = ax + b
  • add=float β€” value to add to the raster values. Coefficient b in the equation y = 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 using type=CELL, you should set the add option to 0.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