r.to.rast3elev(1grass)
π r.to.rast3elev π (GRASS User's Manual)
okay so bestie, this is the r.to.rast3elev page from the GRASS User's Manual, and honestly? it's giving glow-up for your 2D maps. let's get into it π«Ά
β¨ NAME β¨
r.to.rast3elev β creates a 3D volume map based on 2D elevation and value raster maps. yeah. it literally stacks your flat little rasters into a whole voxel vibe. π
π KEYWORDS π
raster, conversion, raster3d, voxel
likeβ¦ the tags are right there. iykyk. β¨
πΈ SYNOPSIS πΈ
r.to.rast3elev
r.to.rast3elev --help
r.to.rast3elev [-ulm] input=name[,name,...] elevation=name[,name,...]
output=name [upper=float] [lower=float] [tilesize=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
flags bestie π©
-uβ use the input map values to fill the upper cells-lβ use the input map values to fill the lower cells-mβ use 3D raster mask (if it exists) with input map--overwriteβ allow output files to overwrite existing files (chaotic but go off)--helpβ print usage summary--verboseβ verbose module output (she's chatty, we love her)--quietβ quiet module output (she's mysterious, also iconic)--uiβ force launching GUI dialog
parameters π
input=name[,name,...]β required. name of input raster map(s)elevation=name[,name,...]β required. name of input elevation raster map(s)output=nameβ required. name for output 3D raster mapupper=floatβ the value to fill the upper cells, default is nulllower=floatβ the value to fill the lower cells, default is nulltilesize=integerβ the maximum tile size in kilo bytes. default is 32KB. Default:32
π DESCRIPTION π
r.to.rast3elev creates a 3D volume map based on 2D elevation and value raster maps. no cap, that's the whole point. π
and listen β if the 2d and 3d region settings are different, the 2d resolution will be adjust to the 3d resolution. so like, don't stress about mismatched regions, she handles it.
How r.to.rast3elev works (there's a diagram, go look at it, it's cute)
π NOTES π
the height of the 2D elevation maps will be used to verify the position within the 3D region. so the elevation raster is basically the bouncer at the club, checking who gets in. π§
if the cell value of the elevation raster maps is located within the 3D region, the cell value of the appropriate 2D input raster maps will be written to the associated 3D cell. slay. β¨
and there are flags and options to fill the upper and lower 3D cells with a specific value, or the input raster maps values. you have options, bestie. π
π₯ EXAMPLES π₯
simple Spearfish sample data set example
g.region raster=elevation.10m -p
g.region res=200 res3=200 t=2000 b=0 tbres=20 -p
# Write the values of raster map soils based on the elevation of elevation.10m
# to the 3D map volev
r.to.rast3elev in=soils elev=elevation.10m out=volev
# Write the values of map soils based on the elevation of elevation.10m
# to the 3D map volev_l and fill the lower cells with the soils map values
r.to.rast3elev in=soils elev=elevation.10m out=volev_l -l
# Write the values of map soils based on the elevation of elevation.10m
# to the 3D map volev_u and fill the upper cells with the soils map values
r.to.rast3elev in=soils elev=elevation.10m out=volev_u -u
# Example with multiple elevation maps.
## first we need three support maps
r.mapcalc expression="one = 1"
r.mapcalc expression="two = 2"
r.mapcalc expression="three = 3"
## Now we generate the new evelation maps
r.mapcalc expression="elev_mid = elevation.10m - 500"
r.mapcalc expression="elev_bottom = elevation.10m - 1000"
## Now fill the lower cells below the elevation maps with the values one, two and three
r.to.rast3elev -l input=one,two,three elevation=elevation.10m,elev_mid,elev_bottom output=threelayer
## Export the map for visualization with paraview (https://www.paraview.org)
## By default the null value is -9999.99, we adjust it to 0.0 for
## better visualization
r3.out.vtk null=0.0 input=threelayer output=/tmp/threelayer.vtk
# Start paraview
paraview --data=/tmp/threelayer.vtk
# Note: First you need to choose the surface representation style and
# then color by "threelayer" in paraview.
okay important lil heads up: after you startparaview, first you need to choose the surface representation style and then color by"threelayer"in paraview. do it in that order or you'll be confused and i'll be sad. π
π¦ SEE ALSO π¦
r.to.rast3, r3.cross.rast, g.region
go read those too, they're the friend group. π
π AUTHOR π
Soeren Gebbert
β SOURCE CODE β
Available at: r.to.rast3elev source code (history)
Latest change: Tuesday Feb 18 17:20:26 2025 in commit: 688e625e7db3be9a465ce99ba25f36d2ebdd5aeb
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie!! no notes, you ate. π β¨ the source/version is GRASS 8.5.0, the copyright is Β© 2003-2026 GRASS Development Team (they've been at this for a minute), it's the GRASS 8.5.0 Reference Manual, latest change Tuesday Feb 18 17:20:26 2025 in that commit above. periodt. πππ«Ά
π¦ 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