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 moment
  • config=name [required] โ€” Configuration file. the rules of the game
  • alpha=string [required] โ€” Alpha value is the order of the generalized entropy
  • output=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 entropy
  • alpha: order of the generalized entropy
  • i: patch type
  • S: number of different patch types
  • pi: proportional abundance of patch type i

periodt. that's the formula energy ๐Ÿงฎโœจ


๐Ÿ”ฅ NOTES ๐Ÿ”ฅ

okay so pay attention because this part is important:

Do not use absolute path names for the config and output file/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 group
  • g.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