r.li.renyi(1)

πŸ’– r.li.renyi πŸ’–

okay bestie, so this is a page from the GRASS GIS User's Manual β€” section r.li.renyi(1), one of the raster modules β€” and it's literally about calculating Renyi's diversity index on a raster map. landscape structure analysis girlies rise up πŸ¦‹

✨ NAME ✨

r.li.renyi β€” calculates Renyi's diversity index on a raster map. that's the whole job. she does one thing and she does it πŸ’…

πŸ”‘ KEYWORDS πŸ”‘

raster, landscape structure analysis, diversity index

🌸 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. chaotic but sometimes necessary, no cap 😌
  • --help β€” prints the usage summary. your girl when you're lost fr
  • --verbose β€” verbose module output. she will talk more πŸ’¬
  • --quiet β€” quiet module output. she will talk less 🀫
  • --ui β€” force launching the GUI dialog. for when you want the pretty buttons ✨

πŸŽ€ Parameters πŸŽ€

  • input=name [required] β€” name of input raster map. the map you're analyzing, your main character πŸ—ΊοΈ
  • config=name [required] β€” configuration file. the settings file, she's important
  • alpha=string [required] β€” "Alpha value is the order of the generalized entropy". so alpha is the order, and order is alpha. keep up 🫢
  • output=name [required] β€” name for output raster map. where the results land πŸ“

πŸ’œ DESCRIPTION πŸ’œ

r.li.renyi calculates the "Renyi's diversity index" as:

with:

  • H: Renyi entropy
  • alpha: order of the generalized entropy
  • i: patch type
  • S: number of different patch types
  • pi: proportional abundance of patch type i

like yes the formula is implied and the variables are all spelled out for you, iconic behavior honestly πŸ‘‘

πŸ“ NOTES πŸ“

do NOT use absolute path names for the config and output file/map parameters. just don't, bestie. the module will not be happy πŸ’€

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 going, mkay 🧚

if the input raster map contains only NULL values then r.li.renyi returns NULL. that's it, that's the whole mood 🌈

πŸ”₯ EXAMPLES πŸ”₯

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

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.renyi input=forests conf=movwindow7 out=forests_renyi_mov7_a06 alpha=0.6
r.univar forests_renyi_mov7_a06

forest map (North Carolina sample dataset) example:

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

πŸ‘€ SEE ALSO πŸ‘€

r.li β€” package overview, g.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 πŸ‘‘

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). absolute legends, we stan πŸ’–

πŸ’» SOURCE CODE πŸ’»

available at: r.li.renyi source code (history)

accessed: Saturday Jan 17 05:40:55 2026

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


and that's a wrap, bestie πŸŽ€ this was r.li.renyi(1) from GRASS GIS 8.4.2, Β© 2003-2025 GRASS Development Team, straight outta the GRASS GIS 8.4.2 Reference Manual β€” go forth and compute that entropy, periodt βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from