r.topidx(1)

πŸ’§ r.topidx β€” the GRASS GIS manual, but make it cute

okay bestie, welcome to the GRASS GIS User's Manual page for r.topidx ✨ it's a 1 (section one, we're fancy like that) and it's about to give you a topographic index, no cap πŸ¦‹


🌸 NAME 🌸

r.topidx β€” makes a topographic index (aka the wetness index) raster map, built from an elevation raster map. that's it, that's the whole thing πŸ’…


πŸŽ€ KEYWORDS πŸŽ€

raster, hydrology, wetness, topographic index β€” yes she has range πŸ‘‘


✨ SYNOPSIS ✨

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

🫢 Flags:

  • --overwrite β€” let the output files just overwrite existing files. bold move, respect 🫑
  • --help β€” prints the usage summary, for when you're lost (we've all been there πŸ™ˆ)
  • --verbose β€” verbose module output, she's chatty and we love that
  • --quiet β€” quiet module output. shhh 🀫
  • --ui β€” force launches the GUI dialog, for the visual learners πŸ’–

πŸ¦‹ Parameters:

  • input=name β€” [required] name of the input elevation raster map. mandatory. non-negotiable. periodt.
  • output=name β€” [required] name for the output topographic index raster map. also mandatory bestie πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

okay so r.topidx creates a topographic index (the wetness index), specifically ln(a/tan(beta)), as a map, derived 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) πŸ“

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

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

also, r.stats -Anc prints out averaged statistics for topographic index. cute, useful, we stan ⭐

🚨 lat/long projects are NOT supported. if your data isn't projected, please create a new project with a projected coordinate reference system and reproject the data into it, then run r.topidx from that project. no shortcuts, bestie 😭

🌈 EXAMPLE 🌈

running the command below will generate 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 πŸ—ΊοΈβœ¨ (it's giving beautiful, 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.

πŸ‘€ SEE ALSO πŸ‘€

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

also: Known issues β€” go look, iykyk 🫢


πŸ’– AUTHORS πŸ’–

Huidae Cho Hydro Laboratory, Kyungpook National University, South Korea πŸ‡°πŸ‡·

Based on GRIDATB.FOR by Keith Beven. iconic lineage fr fr 🌟


🧚 SOURCE CODE 🧚

Available at: r.topidx source code (history)

Accessed: Saturday Jan 17 05:41:04 2026

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


okay that's the whole page, you're officially hydrated (hydrologically speaking πŸ’§). this was the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, running on GRASS 8.4.2 β€” and yeah, accessed Saturday Jan 17 05:41:04 2026, so consider yourself timestamped bestie πŸŽ€βœ¨ slay, go make some topographic indices πŸ’…πŸ¦‹

πŸ“¦ where this page comes from