r.topidx(1grass)

✨ r.topidx ✨

okay bestie, welcome to the r.topidx manual page from the GRASS User's Manual πŸ’– β€” this is the tool that builds you a topographic index (aka the wetness index, iykyk) as a raster map, straight off an elevation raster. we're gonna read it together and it's gonna be so good 🫢

🌸 KEYWORDS 🌸

raster, hydrology, wetness, topographic index

like, the whole vibe in five words, periodt.


✨ SYNOPSIS ✨

r.topidx
r.topidx --help
r.topidx input=name output=name  [--overwrite]  [--help]  [--verbose]
        [--quiet]  [--ui]

πŸŽ€ FLAGS πŸŽ€

  • --overwrite β€” let those output files just bulldoze any existing files with the same name. consent matters, so this is opt-in πŸ’…
  • --help β€” prints the usage summary. the little "what do I even type" button πŸ₯Ί
  • --verbose β€” verbose module output, i.e. it tells you everything it's doing, main character narration mode πŸ‘‘
  • --quiet β€” quiet module output. no yapping, just results 🀫
  • --ui β€” force launches the GUI dialog. for when you want the pretty buttons 🌈

πŸ¦‹ PARAMETERS πŸ¦‹

  • input=name [required] β€” the name of your input elevation raster map. mandatory bestie, no input no output ✨
  • output=name [required] β€” the name for the output topographic index raster map. name it something cute πŸŽ€

πŸ’§ DESCRIPTION πŸ’§

so r.topidx creates the topographic index (wetness index) map, and the formula is:

ln(a/tan(beta))

built from an elevation map, where:

  • a = the area of the hillslope per unit contour length that drains through any point 🌊
  • tan(beta) = the local surface topographic slope, which is (delta vertical) / (delta horizontal) πŸ“

ngl that's the whole mathematical vibe right there.

Input maps are allowed to have NULL values, no drama. say you've got a raster mask set for a watershed (like, using a basin map from r.water.outlet), then this command right here will create a masked elevation map called belev:

r.mapcalc "belev = if(isnull(basin), basin, elev)"

and r.stats -Anc prints out averaged statistics for the topographic index. cute for checking your work πŸ“Š

⚠️ okay important bestie, listen up: lat/long projects are NOT supported. not even a little. if your data is not projected, please create a new project with a projected coordinate reference system and reproject the data there, then run r.topidx from that project. no shortcuts, fr fr 😭

🌈 EXAMPLE 🌈

run the command below and you get the topographic index map shown in the figure:

g.region raster=elevation -p
r.topidx input=elevation output=topidx_elevation

Figure: topographic index map derived from elevation map β€” she's iconic, honestly πŸ–ΌοΈβœ¨


πŸ“š REFERENCES πŸ“š

  • Cho, H., 2000. GIS Hydrological Modeling System by Using Programming Interface of GRASS. Master's Thesis, Department of Civil Engineering, Kyungpook National University, Korea.
  • Moore, I.D., R.B. Grayson, and A.R. Ladson, 1991. Digital Terrain Modeling: A Review of Hydrological, Geomorphological, and Biological Applications. Hydrological Processes 5:3-30.

(the academic receipts πŸ§ΎπŸ’œ)


πŸ‘€ SEE ALSO πŸ‘€

r.topmodel, r.water.outlet, r.mapcalc

Known issues


πŸ’… AUTHORS πŸ’…

Huidae Cho Hydro Laboratory, Kyungpook National University, South Korea

Based on GRIDATB.FOR by Keith Beven.

shoutout to the legends 🫢


πŸ”₯ SOURCE CODE πŸ”₯

Available at: r.topidx source code (history)

Latest change: Thursday Nov 06 22:27:54 2025 in commit: 298b38614712934179355ea767403d6bfea8f5f9

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page, you ate it up πŸ“ this was the r.topidx page, fresh out of GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual πŸ’– go make some wetness maps, bestie β€” ily, bye πŸ˜­πŸ‘‘

πŸ“¦ where this page comes from