r3.gradient(1)

✨ r3.gradient ✨

okay bestie, welcome to the GRASS GIS User's Manual πŸ’– this one's all about r3.gradient, and no cap, it's a bop.


🌸 NAME 🌸

r3.gradient β€” it computes the gradient of a 3D raster map and outputs the gradient components as three 3D raster maps. literally that's the whole gig 🫢


πŸŽ€ KEYWORDS πŸŽ€

raster3d, gradient, voxel


✨ SYNOPSIS ✨

r3.gradient
r3.gradient --help
r3.gradient input=name
output=grad_x,grad_y,grad_z[,grad_x,grad_y,grad_z,...]
[blocksize=size_x,size_y,size_z[,size_x,size_y,size_z,...]]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸ¦‹ Flags πŸ¦‹

  • --overwrite β€” lets your output files just bulldoze over existing files. iconic but also, be careful bestie πŸ’…
  • --help β€” prints the usage summary so you're not out here guessing
  • --verbose β€” verbose module output, aka it tells you everything
  • --quiet β€” quiet module output, aka it tells you nothing (respect)
  • --ui β€” forces the GUI dialog to launch. main character energy, go off πŸͺŸ

πŸ’œ Parameters πŸ’œ

  • input=name [required] β€” the name of your input 3D raster map
  • output=grad_x,grad_y,grad_z[,grad_x,grad_y,grad_z,...] [required] β€” name(s) for your output 3D raster map(s)
  • blocksize=size_x,size_y,size_z[,size_x,size_y,size_z,...] β€” the size of blocks
    • Default: 30,30,20

🌈 DESCRIPTION 🌈

so what does r3.gradient actually do, you ask? it computes the gradient from a 3D raster map, periodt. the results? three whole 3D raster maps, and they describe the x, y, z components of the computed gradient field. three maps. three axes. it's giving coordinate slay πŸ’…βœ¨


πŸ“ EXAMPLES πŸ“

first up, create a 3D raster:

# create a 3D raster
g.region s=0 n=100 w=0 e=100 b=0 t=100 -p
r3.mapcalc "test_gradient = sqrt(row()*row() +col()*col()+ depth()*depth())"
# compute gradient
r3.gradient input=test_gradient output=grad_x,grad_y,grad_z

and that's it. you just did that. ate and left no crumbs πŸ”₯


🧚 SEE ALSO 🧚

r3.flow, r.flow


πŸ‘‘ AUTHOR πŸ‘‘

Anna Petrasova, NCSU GeoForAll Lab, developed during GSoC 2014. periodt, we stan πŸ’–


⭐ SOURCE CODE ⭐

Available at: r3.gradient source code (history)

Accessed: Saturday Jan 17 05:41:14 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 🫢 this was r3.gradient, running under GRASS 8.4.2, and you understood every word of it. no cap, obsessed πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from