r.li.renyi(1grass)
๐ r.li.renyi โ the manual page, but make it make sense ๐
okay bestie, so r.li.renyi is a GRASS GIS module โ part of the r.li family โ and honestly? it's giving landscape ecologist main character energy. Let's get into it ๐
โจ NAME โจ
r.li.renyi โ calculates Renyi's diversity index on a raster map. That's it, that's the whole job, and she does it beautifully ๐ฆ
๐ท๏ธ KEYWORDS ๐ท๏ธ
raster, landscape structure analysis, diversity index โ yes she contains multitudes ๐
๐ธ SYNOPSIS ๐ธ
r.li.renyi
r.li.renyi --help
r.li.renyi input=name config=name alpha=string output=name
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
๐ Flags
--overwriteโ lets your output files just... overwrite existing files. no hesitation, no "are you sure", she simply replaces them ๐--helpโ prints the usage summary, aka the "bestie explain" button--verboseโ verbose module output, she tells you everything, unprompted, like a group chat at 2am--quietโ quiet module output, the opposite vibe, she says nothing and just works โจ--uiโ forces the GUI dialog to launch, for when clicking > typing
๐ง Parameters
input=name[required]โ Name of input raster map. your map, your momentconfig=name[required]โ Configuration file. the rules of the gamealpha=string[required]โ Alpha value is the order of the generalized entropyoutput=name[required]โ Name for output raster map. name her something cute ๐
๐ DESCRIPTION ๐
r.li.renyi calculates the "Renyi's diversity index" as:
with:
H: Renyi entropyalpha: order of the generalized entropyi: patch typeS: number of different patch typespi: proportional abundance of patch typei
periodt. that's the formula energy ๐งฎโจ
๐ฅ NOTES ๐ฅ
okay so pay attention because this part is important:
Do not use absolute path names for theconfigandoutputfile/map parameters. nope. don't do it. she will not vibe with that.
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). so like, know where your stuff is landing bestie ๐
Also, if the input raster map contains only NULL values then r.li.renyi returns NULL. she's honest about it. no cap ๐
๐ EXAMPLES ๐
Example 1 โ the basics
To calculate Renyi'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.renyi input=my_map conf=my_conf output=my_out alpha=0.6
Example 2 โ 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.renyi input=forests conf=movwindow7 out=forests_renyi_mov7_a06 alpha=0.6
r.univar forests_renyi_mov7_a06
Example 3 โ Forest map (North Carolina sample dataset) ๐ฆ
g.region raster=landclass96 -p
r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
r.li.renyi input=forests conf=movwindow7 out=forests_renyi_mov7
# verify
r.univar forests_renyi_mov7
r.to.vect input=forests output=forests type=area
d.mon wx0
d.rast forests_renyi_mov7
d.vect forests type=boundary
look at that workflow, she ATE ๐
๐ SEE ALSO ๐
r.li(package overview) โ the whole girl groupg.gui.rlisetupโ where you set your config up
๐ 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)
(the classic. the blueprint. we respect her ๐ซถ)
๐ AUTHORS ๐
Luca Delucchi and Duccio Rocchini, Fondazione E. Mach (Italy), based on the r.li.shannon code developed by Serena Pallecchi, student of Computer Science University of Pisa (Italy).
like okay collaboration icons โจ
๐ป SOURCE CODE ๐ป
Available at: r.li.renyi source code (history)
Latest change: Tuesday Apr 29 06:19:47 2025 in commit:
12f893be22c8aeda9b048070dde6a4a230791e2a
Indexes, if you're feeling navigational: Main index | Raster index | Topics index | Keywords index | Graphical index | Full index ๐
so yeah, that's r.li.renyi(1grass) from the GRASS 8.5.0 Reference Manual, ยฉ 2003-2026 GRASS Development Team โ thanks for coming to my ted talk, now go compute some entropy bestie ๐โจ๐ธ๐ฆ๐
๐ฆ 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