r.li.padsd(1)

r.li.padsd πŸ’…βœ¨

okay bestie, this is r.li.padsd from the GRASS GIS User's Manual β€” a lil module that does landscape structure analysis and is lowkey obsessed with patch index stuff. it lives in the raster world. let's go πŸ¦‹


✨ NAME ✨

r.li.padsd β€” calculates standard deviation of patch area for a raster map πŸŽ€


🌸 KEYWORDS 🌸

raster, landscape structure analysis, patch index


🫢 SYNOPSIS 🫢

r.li.padsd
r.li.padsd --help
r.li.padsd input=name config=name output=name  [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags:

  • --overwrite β€” allow output files to overwrite existing files (yes it will actually do that, be brave)
  • --help β€” print usage summary
  • --verbose β€” verbose module output (it talks more, we love a chatty king)
  • --quiet β€” quiet module output (shhh era)
  • --ui β€” force launching GUI dialog

πŸ¦‹ Parameters:

  • input=name [required] β€” name of input raster map
  • config=name [required] β€” configuration file
  • output=name [required] β€” name for output raster map

πŸ’– DESCRIPTION πŸ’–

so r.li.padsd calculates the standard deviation of patch area sizes in hectares, and it does it like this:

with:

  • MPS: mean patch area size
  • ai: area of patch i
  • Npatch: number of patches
ngl the actual formula is not spelled out in this manual page β€” the text literally just says "as:" and then "with:" and then these definitions, so that's exactly what you're getting. no cap, no guessing, we don't invent math here πŸ™ˆ

this index gets calculated using a 4 neighbour algorithm β€” meaning diagonal cells are ignored when tracing a patch. periodt. πŸ’…


🧚 NOTES 🧚

do NOT use absolute path names for the config and output file/map parameters. like, seriously. it's giving chaos.

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\ (MS-Windows)
  • $HOME/.grass8/r.li/output/ (GNU/Linux)
the result is NULL if the sample area contains only NULL values. empty is empty, bestie 😭

🌈 EXAMPLES 🌈

wanna calculate the patch area distribution standard deviation index on map my_map, using my_conf configuration file (which you already defined with g.gui.rlisetup) and save the results in my_out? say less, run this:

r.li.padsd input=my_map conf=my_conf output=my_out

πŸ“ 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.padsd input=forests conf=movwindow7 out=forests_padsd_mov7
r.univar forests_padsd_mov7

πŸ“ Forest map (North Carolina sample dataset) example:

g.region raster=landclass96 -p
r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
r.li.padsd input=forests conf=movwindow7 out=forests_padsd_mov7
# verify
r.univar forests_padsd_mov7
r.to.vect input=forests output=forests type=area
d.mon wx0
d.rast forests_padsd_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 πŸ’œ

  • Michael Shapiro - CERL (patch identification)
  • Markus Metz (statistics)

⭐ SOURCE CODE ⭐

Available at: r.li.padsd source code (history)

Accessed: Saturday Jan 17 05:40:54 2026

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


okay that's the whole thing bestie, you ate πŸ’…βœ¨ this was brought to you by GRASS GIS 8.4.2 (that's the version in the footer, fr fr), the GRASS GIS 8.4.2 Reference Manual, and Β© 2003-2025 GRASS Development Team. mwah, go map something iconic πŸ¦‹πŸŒΈπŸŽ€

πŸ“¦ where this page comes from