r.li.simpson(1grass)
π r.li.simpson(1grass) β the whole vibe π
okay bestie, so this is r.li.simpson, a GRASS manual page, and it is literally about calculating Simpson's diversity index on a raster map. yes. that Simpson. the diversity one. π¦
KEYWORDS: raster, landscape structure analysis, diversity index β¨
πΈ SYNOPSIS πΈ
r.li.simpson
r.li.simpson --help
r.li.simpson input=name config=name output=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags: π
--overwriteβ lets output files just. overwrite existing files. no respect for the old ones, periodt π--helpβ prints the usage summary, aka the "what do I even type" moment--verboseβ verbose module output, so it tells you everything it's doing, main character energy--quietβ quiet module output, the "don't talk to me rn" setting π€«--uiβ force launches the GUI dialog, for when clicking > typing
π«Ά Parameters: π«Ά
input=nameβ required. name of input raster map. the map you're vibing with πΊοΈconfig=nameβ required. configuration file. yes you need one.output=nameβ required. name for output raster map.
β¨ DESCRIPTION β¨
r.li.simpson calculates the "Simpson's diversity index" β that's the phrase, quoted like that, in the original β as:
with:
i: patch type πm: number of different patch typespi: proportional abundance of patch type i
(yes, the page really does hand you an "as:" and then a "with:" and then just the variable list. that's the whole setup. it's giving mysterious. iykyk π₯)
π NOTES π
π Do NOT use absolute path names for theconfigandoutputfile/map parameters. fr fr. just don't.
If the "moving window" method was selected in g.gui.rlisetup, then the output will be a raster map. otherwise?? an ASCII file gets generated in the folder
C:\Users\userxy\AppData\Roaming\GRASS8\r.li\output\on MS-Windows πͺ$HOME/.grass8/r.li/output/on GNU/Linux π§
Also! If the input raster map contains only NULL values, then r.li.simpson returns NULL. that's it. that's the answer. nothing. NULL. π
π EXAMPLES π
the basic one π§
want Simpson's diversity index on map my_map, using my_conf config file (which you previously defined with g.gui.rlisetup), and saving results in my_out? run:
r.li.simpson input=my_map conf=my_conf output=my_out
Forest map, Spearfish sample dataset π²
g.region raster=landcover.30m -p
r.mapcalc "forests = if(landcover.30m >= 41 && landcover.30m <= 43,1,null())"
r.li.simpson input=forests conf=movwindow7 out=forests_simpson_mov7
r.univar forests_simpson_mov7
Forest map, North Carolina sample dataset π³
g.region raster=landclass96 -p
r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
r.li.simpson input=forests conf=movwindow7 out=forests_simpson_mov7
# verify
r.univar forests_simpson_mov7
r.to.vect input=forests output=forests type=area
d.mon wx0
d.rast forests_simpson_mov7
d.vect forests type=boundary
not me noticing the examples use conf= and out= while the synopsis says config= and output= β both spellings show up in the original and i am simply reporting the receipts ππ
π SEE ALSO π
r.li(package overview) β the whole family, go meet themg.gui.rlisetup
π REFERENCES π
McGarigal, K., and B. J. Marks. 1995. FRAGSTATS: spatial pattern analysis program for quantifying landscape structure. USDA For. Serv. Gen. Tech. Rep. PNW-351. (PDF)
π AUTHORS π
- Serena Pallecchi, student of Computer Science University of Pisa (Italy).
- Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)
π₯ SOURCE CODE π₯
Available at: r.li.simpson source code (history)
Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the page, bestie β this was GRASS 8.5.0, r.li.simpson(1grass), go forth and index some diversity πΈπ¦β¨π«Ά
π¦ 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