land.metrics | R Documentation |
Calculates a variety of landscape metrics, on binary rasters, for polygons or points with a buffer distance
land.metrics(
x,
y,
bkgd = NA,
metrics = c("prop.landscape"),
bw = 1000,
latlon = FALSE,
echo = FALSE
)
x |
SpatalPointsDataFrame or SpatalPolgonsDataFrame class object |
y |
raster class object |
bkgd |
Background value (will be ignored) |
metrics |
Numeric index or name(s) of desired metric (see available metrics) |
bw |
Buffer distance (ignored if x is SpatalPolgonsDataFrame) |
latlon |
(FALSE/TRUE) Is raster data in lat-long |
echo |
(FALSE/TRUE) Print object ID at each iteration |
The following metrics are available:
class - (always included) particular patch type from the original input matrix.
n.patches - the number of patches of a particular patch type or in a class.
total.area - the sum of the areas (m2) of all patches of the corresponding patch type.
prop.landscape - the proportion of the total landscape represented by this class
patch.density - the numbers of patches of the corresponding patch type divided by total landscape area (m2).
total.edge - the total edge length of a particular patch type.
edge.density - edge length on a per unit area basis that facilitates comparison among landscapes of varying size.
landscape.shape.index - a standardized measure of total edge or edge density that adjusts for the size of the landscape.
largest.patch.index - largest patch index quantifies the percentage of total landscape area comprised by the largest patch.
mean.patch.area - average area of patches.
sd.patch.area - standard deviation of patch areas.
min.patch.area - the minimum patch area of the total patch areas.
max.patch.area - the maximum patch area of the total patch areas.
perimeter.area.frac.dim - perimeter-area fractal dimension equals 2 divided by the slope of regression line obtained by regressing the logarithm of patch area (m2) against the logarithm of patch perimeter (m).
mean.perim.area.ratio - the mean of the ratio patch perimeter. The perimeter-area ratio is equal to the ratio of the patch perimeter (m) to area (m2).
sd.perim.area.ratio - standard deviation of the ratio patch perimeter.
min.perim.area.ratio - minimum perimeter area ratio
max.perim.area.ratio - maximum perimeter area ratio.
mean.shape.index - mean of shape index
sd.shape.index - standard deviation of shape index.
min.shape.index - the minimum shape index.
max.shape.index - the maximum shape index.
mean.frac.dim.index - mean of fractal dimension index.
sd.frac.dim.index - standard deviation of fractal dimension index.
min.frac.dim.index - the minimum fractal dimension index.
max.frac.dim.index - the maximum fractal dimension index.
total.core.area - the sum of the core areas of the patches (m2).
prop.landscape.core - proportional landscape core
mean.patch.core.area - mean patch core area.
sd.patch.core.area - standard deviation of patch core area.
min.patch.core.area - the minimum patch core area.
max.patch.core.area - the maximum patch core area.
prop.like.adjacencies - calculated from the adjacency matrix, which shows the frequency with which different pairs of patch types (including like adjacencies between the same patch type) appear side-by-side on the map (measures the degree of aggregation of patch types).
aggregation.index - computed simply as an area-weighted mean class aggregation index, where each class is weighted by its proportional area in the landscape.
landscape.division.index - based on the cumulative patch area distribution and is interpreted as the probability that two randomly chosen pixels in the landscape are not situated in the same patch
splitting.index - based on the cumulative patch area distribution and is interpreted as the effective mesh number, or number of patches with a constant patch size when the landscape is subdivided into S patches, where S is the value of the splitting index.
effective.mesh.size - equals 1 divided by the total landscape area (m2) multiplied by the sum of patch area (m2) squared, summed across all patches in the landscape.
patch.cohesion.index - measures the physical connectedness of the corresponding patch type.
If multiple classes are evaluated a list object with a data.frame for each class containing specified metrics in columns. The data.frame is ordered and shares the same row.names as the input feature class and can be directly joined to the @data slot. For single class problems a data.frame object is returned.
Modifications to the function incorporate multi-class metrics by fetching the unique values of the raster and creating a list object containing a data.frame for each class. Unfortunately, retrieving unique values is a very slow function.
It is critical to note that if using polygon units that, the resulting metric represents the spatial pattern within each unique aggregate unit and not a metric of the unit itself. That is to say, a metric such as fractal dimension represents the fractal dimension of the pattern within the unit and not of the unit.
Jeffrey S. Evans <jeffrey_evans@tnc.org>
ClassStat
, connected.pixels
, PatchStat
library(raster)
library(terra)
library(sp)
r <- raster(nrows=180, ncols=360, xmn=571823.6, xmx=616763.6, ymn=4423540,
ymx=4453690, resolution=270, crs = CRS("+proj=utm +zone=12 +datum=NAD83
+units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"))
r[] <- sample(c(0,1), ncell(r), replace=TRUE)
x <- sampleRandom(r, 10, na.rm = TRUE, sp = TRUE)
lmet <- c("prop.landscape", "edge.density", "prop.like.adjacencies", "aggregation.index")
( class.1 <- land.metrics(x=x, y=r, bw=1000, bkgd = 0, metrics = lmet) )
( all.class <- land.metrics(x=x, y=r, bw=1000, bkgd = NA, metrics = lmet ) )
# Pull metrics associated with class "0"
all.class[["0"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.