.TH r.li.patchdensity 1grass "" "GRASS 8.3.1" "GRASS GIS User's Manual" .SH NAME \fI\fBr.li.patchdensity\fR\fR \- Calculates patch density index on a raster map, using a 4 neighbour algorithm .SH KEYWORDS raster, landscape structure analysis, patch index .SH SYNOPSIS \fBr.li.patchdensity\fR .br \fBr.li.patchdensity \-\-help\fR .br \fBr.li.patchdensity\fR \fBinput\fR=\fIname\fR \fBconfig\fR=\fIname\fR \fBoutput\fR=\fIname\fR [\-\-\fBoverwrite\fR] [\-\-\fBhelp\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] [\-\-\fBui\fR] .SS Flags: .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-help\fR" 4m .br Print usage summary .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .IP "\fB\-\-ui\fR" 4m .br Force launching GUI dialog .SS Parameters: .IP "\fBinput\fR=\fIname\fR \fB[required]\fR" 4m .br Name of input raster map .IP "\fBconfig\fR=\fIname\fR \fB[required]\fR" 4m .br Configuration file .IP "\fBoutput\fR=\fIname\fR \fB[required]\fR" 4m .br Name for output raster map .SH DESCRIPTION \fIr.li.patchdensity\fR calculates the \(dqpatch density index\(dq, the number of patches per square kilometer, as: .br .nf \fC PD = Npatch / A \fR .fi with: .RS 4n .IP \(bu 4n \fBA\fR:sampling area size .IP \(bu 4n \fBNpatch\fR: number of patches .RE .PP This index is calculated using a 4 neighbour algorithm, diagonal cells are ignored when tracing a patch. .SH NOTES Do not use absolute path names for the \fBconfig\fR and \fBoutput\fR file/map parameters. If the \(dqmoving window\(dq method was selected in \fBg.gui.rlisetup\fR, then the output will be a raster map, otherwise an ASCII file will be generated in the folder C:\(rsUsers\(rsuserxy\(rsAppData\(rsRoaming\(rsGRASS8\(rsr.li\(rsoutput\(rs (MS\-Windows) or $HOME/.grass8/r.li/output/ (GNU/Linux). .PP A sample area of only NULL values is considered to have zero patches, that is, the result is always ≥ 0. .SH EXAMPLES To calculate patch density index on map \fImy_map\fR, using \fImy_conf\fR configuration file (previously defined with \fIg.gui.rlisetup\fR) and saving results in \fImy_out\fR, run: .br .nf \fC r.li.patchdensity input=my_map conf=my_conf output=my_out \fR .fi .PP Example for Spearfish forest areas: .br .nf \fC g.region raster=landcover.30m \-p # extract forested areas: r.category landcover.30m r.mapcalc \(dqforests = if(landcover.30m >= 41 && landcover.30m <= 43, 1, null())\(dq # patch density (7x7 moving window defined in g.gui.rlisetup): r.li.patchdensity forests conf=movwindow7 out=forests_p_dens7 r.univar forests_p_dens7 d.rast.leg forests_p_dens7 r.to.vect forests out=forests feature=area d.vect forests type=boundary \fR .fi .PP Forest map (North Carolina sample dataset) example: .br .nf \fC g.region raster=landclass96 \-p r.mapcalc \(dqforests = if(landclass96 == 5, 1, null() )\(dq r.li.patchdensity input=forests conf=movwindow7 out=forests_patchdensity_mov7 # verify r.univar forests_patchdensity_mov7 r.to.vect input=forests output=forests type=area d.mon wx0 d.rast forests_patchdensity_mov7 d.vect forests type=boundary \fR .fi .SH SEE ALSO \fI r.li \- package overview .br g.gui.rlisetup \fR .SH 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) .SH AUTHORS Michael Shapiro \- CERL (patch identification) .br Markus Metz (statistics) .SH SOURCE CODE .PP Available at: r.li.patchdensity source code (history) .PP Accessed: Sunday Dec 17 17:21:53 2023 .PP Main index | Raster index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2023 GRASS Development Team, GRASS GIS 8.3.1 Reference Manual