r.li.mpa(1)
π r.li.mpa π
okay bestie, welcome to the GRASS GIS User's Manual page for r.li.mpa(1) β yes that's the manual name, and yes we're gonna read it together, it's fine, it's fun, I promise π«Ά
β¨ NAME β¨
r.li.mpa β it calculates the mean pixel attribute index on a raster map. that's the whole job. she's a specialist. she does one thing and she does it gorgeously π
πΈ KEYWORDS πΈ
raster, landscape structure analysis, patch index
iykyk π§
π SYNOPSIS π
r.li.mpa
r.li.mpa --help
r.li.mpa input=name config=name output=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags π
--overwriteβ lets output files overwrite files that already exist. yes she will absolutely bulldoze your old file, no cap π--helpβ prints the usage summary. the classic "what does this do again" button π₯Ί--verboseβ verbose module output. she talks more. love that for her π¬--quietβ quiet module output. she talks less. also love that for her π€«--uiβ forces the GUI dialog to launch. point-and-click era β¨
π Parameters π
input=name[required] β name of input raster map. mandatory bestie, no skipping πconfig=name[required] β configuration file. also mandatory πoutput=name[required] β name for output raster map. still mandatory π
π¦ DESCRIPTION π¦
r.li.mpa (mean pixel attribute) calculates the average value of the attribute of all the non-null cells in the sampling area as:
with:
i: attributem: number of non-null attributes in the sampling areawi: number of cells of attribute isize: size of sampling area (in cells)
the way the manpage just says "as:" and then "with:" and moves onβ¦ iconic honestly, she said figure it out π« (that's literally how it's written, we're keeping it exactly as-is)
π NOTES π
- Do not use absolute path names for the
configandoutputfile/map parameters. like, don't. just don't π - 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 folderC:\Users\userxy\AppData\Roaming\GRASS8\r.li\output\(MS-Windows) or$HOME/.grass8/r.li/output/(GNU/Linux). two totally different vibes depending on your OS, slay π» - If the input raster map contains only NULL values then
r.li.mpaconsiders to have 0 patches. - If area is 0
r.li.mpareturns -1; it is possible only if the raster is masked. - If you want to change these -1 values to NULL, run subsequently on the resulting map:
r.null setnull=-1 input=my_map
after index calculation. β
ngl that last one is a whole two-step routine, don't skip the second step or your map is gonna have weird -1s in it π
π₯ EXAMPLES π₯
To calculate the mean pixel attribute 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.mpa 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.mpa input=forests conf=movwindow7 out=forests_mpa_mov7
r.univar forests_mpa_mov7
Forest map (North Carolina sample dataset) example:
g.region raster=landclass96 -p
r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
r.li.mpa input=forests conf=movwindow7 out=forests_mpa_mov7
# verify
r.univar forests_mpa_mov7
r.to.vect input=forests output=forests type=area
d.mon wx0
d.rast forests_mpa_mov7
d.vect forests type=boundary
bestie look at those workflows, she ATE and left no crumbs π
π 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)
academic queen behavior fr fr π
π AUTHORS π
- Serena Pallecchi, student of Computer Science University of Pisa (Italy).
- Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)
- Markus Metz
β SOURCE CODE β
Available at: r.li.mpa source code (history)
Accessed: Saturday Jan 17 05:40:52 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, babe π this manual is from GRASS GIS 8.4.2 and it's dated Saturday Jan 17 05:40:52 2026 (that's the footer energy right there), copyright Β© 2003-2025 GRASS Development Team β go forth and calculate those mean pixel attributes, you absolute icon ππ¦β¨
π¦ 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