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 slices
  • output=string [required] β€” basename for the resultant raster slice maps
  • type=string β€” type of raster map to be created; also described as the storage type for the 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; it's coefficient a in the equation y = ax + b
  • add=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