r.li.shape(1)
π r.li.shape β the shape index bestie π
GRASS GIS User's Manual Β· section 1
okay so. you wanna know how shaped your patches are. no cap, this is the one. β¨
πΈ NAME πΈ
r.li.shape β calculates shape index on a raster map
π KEYWORDS π
raster, landscape structure analysis, patch index
β¨ SYNOPSIS β¨
r.li.shape
r.li.shape --help
r.li.shape input=name config=name output=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π«Ά Flags
--overwriteβ bestie, this lets your output files just bulldoze whatever was already there. allow output files to overwrite existing files π--helpβ prints the usage summary so you're not out here guessing--verboseβ verbose module output, i.e. it tells you everything it's doing--quietβ quiet module output, i.e. it shuts up and just works--uiβ force launching the GUI dialog, for when you want the pretty buttons
π Parameters
input=name[required] β name of input raster mapconfig=name[required] β configuration fileoutput=name[required] β name for output raster map
π DESCRIPTION π
r.li.shape calculates the landscape shape index, and the formula is literally this:
LSI = 0.25 * E / sqrt(A)
with:
- E: sum of all edges
- A: sum of all patch areas
that's it. that's the whole vibe. math ate. π₯
π¦ NOTES π¦
do NOT use absolute path names for theconfigandoutputfile/map parameters. i'm so serious. relative paths only, bestie.
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)$HOME/.grass8/r.li/output/(GNU/Linux)
and if the input raster map contains only NULL values, then r.li.shape returns NULL. it's giving "nothing to see here". π«₯
π EXAMPLES π
to calculate the shape index on map my_map, using the my_conf configuration file (previously defined with g.gui.rlisetup) and saving results in my_out, run:
r.li.shape input=my_map conf=my_conf output=my_out
forest map (Spearfish sample dataset) example β iconic dataset, no notes:
g.region raster=landcover.30m -p
r.mapcalc "forests = if(landcover.30m >= 41 && landcover.30m <= 43,1,null())"
r.li.shape input=forests conf=movwindow7 out=forests_shape_mov7
r.univar forests_shape_mov7
forest map (North Carolina sample dataset) example β the full glow-up, verification and all:
g.region raster=landclass96 -p
r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
r.li.shape input=forests conf=movwindow7 out=forests_shape_mov7
# verify
r.univar forests_shape_mov7
r.to.vect input=forests output=forests type=area
d.mon wx0
d.rast forests_shape_mov7
d.vect forests type=boundary
π SEE ALSO π
r.liβ package overviewg.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 π
Claudio Porta and Lucio Davide Spano, students of Computer Science, University of Pisa (Italy).
Commission from Faunalia Pontedera (PI) (www.faunalia.it)
β SOURCE CODE β
Available at: r.li.shape 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 π
this manual came to you courtesy of GRASS 8.4.2, and yeah β r.li.shape(1) is the section, periodt. go calculate some shapes. π¦β¨
π¦ 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