r.li.simpson(1)
π r.li.simpson β Simpson's Diversity Index, but make it landscape π
okay bestie, gather round, because this is the GRASS GIS module that goes viral for measuring how diverse your patches are. It's r.li.simpson, from the GRASS GIS User's Manual, and it's giving main character energy in landscape structure analysis. π¦
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 your output files just bulldoze whatever was already there. Allow output files to overwrite existing files. π--helpβ prints the usage summary, i.e. the module explaining itself to you. Very self-aware of it.--verboseβ verbose module output. It will not stop talking and honestly? we love that. π£οΈ--quietβ quiet module output. The introvert setting. π€«--uiβ force launching the GUI dialog. For when you want the full graphic design moment. β¨
πΈ Parameters
input=name[required] β Name of input raster map. This is the map you're vibing with.config=name[required] β Configuration file. Your settings, your rules.output=name[required] β Name for output raster map. What you're naming your baby.
π DESCRIPTION π
r.li.simpson calculates the "Simpson's diversity index" as:
with:
i: patch typem: number of different patch typespi: proportional abundance of patch typei
Like, that's the whole recipe. Count your patch types, weigh their abundances, and boom β diversity, quantified. π
π§ NOTES π§
Do not use absolute path names for theconfigandoutputfile/map parameters. Just don't, bestie. Relative paths only, no cap. π«
If the "moving window" method was selected in g.gui.rlisetup, then the output will be a raster map β otherwise an ASCII file will be generated in the folder:
C:\Users\userxy\AppData\Roaming\GRASS8\r.li\output\ (MS-Windows)
or
$HOME/.grass8/r.li/output/ (GNU/Linux)
Also, heads up: if the input raster map contains only NULL values, then r.li.simpson returns NULL. Empty in, empty out, that's just the vibe check failing. π
π EXAMPLES π
To calculate Simpson's diversity index on map my_map, using my_conf configuration file (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) example:
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) example:
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
π SEE ALSO π
r.liβ package overview, and honestly your first stopg.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)
Accessed: Saturday Jan 17 05:40:56 2026
Main index | 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 β r.li.simpson(1) from GRASS 8.4.2, accessed Saturday Jan 17 05:40:56 2026. go forth and measure diversity, you absolute icon πβ¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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