r.li.shape(1grass)
π r.li.shape β the GRASS User's Manual glow-up π
okay bestie, welcome to r.li.shape, section 1grass of the GRASS User's Manual πΈ this lil guy is here to calculate the shape index on a raster map, and honestly? it ate. let's get into it π«Ά
β¨ NAME β¨
r.li.shape β calculates shape index on a raster map π¦
π KEYWORDS π
raster, landscape structure analysis, patch index β iykyk π
π SYNOPSIS π
r.li.shape
r.li.shape --help
r.li.shape input=name config=name output=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags
--overwriteβ allow output files to overwrite existing files (yes, it will absolutely replace your old files, no cap)--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching GUI dialog
π 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 like this, periodt:
LSI = 0.25 * E / sqrt(A)
with:
- E: sum of all edges
- A: sum of all patch areas
π NOTES π
do NOT use absolute path names for theconfigandoutputfile/map parameters. literally just don't, it's giving chaos π
so here's the tea: if the "moving window" method was selected in g.gui.rlisetup, then the output will be a raster map β¨ otherwise an ASCII file gets generated in the folder
C:\Users\userxy\AppData\Roaming\GRASS8\r.li\output\
(that's the MS-Windows one bestie) or
$HOME/.grass8/r.li/output/
(that's GNU/Linux π§)
also!! if the input raster map contains only NULL values, then r.li.shape returns NULL. like, nothing, nada. sorry babe π
π§ EXAMPLES π§
wanna calculate the shape index on map my_map, using the my_conf configuration file (that you previously defined with g.gui.rlisetup) and save results in my_out? run:
r.li.shape input=my_map conf=my_conf output=my_out
Forest map (Spearfish sample dataset) example, obsessed:
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, main character energy π:
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 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 π
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)
Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's a wrap bestie π«Ά this was the GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, and yeah β GRASS 8.5.0, r.li.shape(1grass), slay π
β¨πΈ
π¦ 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