metrics.class
Landscape metrics of every class, as landscapemetrics and FRAGSTATS: area, share (pland), patches, edge density, aggregation, the patches' metrics summarised (mean, sd, cv...). A table of a row per class, and the map of one metric if asked for.
| Input | Type | What it is |
maprequired | raster | the map of classes (or rasters on disk, by blocks) |
| Output | Type | What it is |
table | table | per class: the class and the metrics |
map | map | the metric shown (show) on each class, of a map in memory |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
block_rows | integer | out of core: the map read by blocks of this many rows (a multiple of 64), the same metrics; rasters on disk of more than 250 million cells always are |
show | text | a metric of the level to give as a map |
metrics.cluster
Groups of landscapes or zones with similar metrics (landschaft's SpatialSignatureAnalysis.cluster): k-means of the z-scores (or of the first principal components) from numpy's generator, so the same groups as landschaft, or scipy's hierarchical linkages cut into k clusters. The groups are numbered 0.. in order of first appearance.
| Input | Type | What it is |
tablerequired | table | the signatures (metrics.signatures) or any metrics |
| Output | Type | What it is |
table | table | the rows kept (without NA) and their cluster |
| Setting | Type | What it is |
columns | any | the metrics (default every column but the keys: zone, landscape, class, date...) |
method | text | kmeans (default; k-means++ starts, the best of n_init) or a linkage: ward, average, complete, single, centroid, median, weighted |
components | integer | cluster the first principal components, not the metrics |
n_init | integer | k-means: the starts (default 10) |
seed | integer | k-means: numpy's seed (default 0) |
krequired | integer | the number of clusters |
metrics.clustergram
Clusters for a range of k (Schonlau's clustergram, landschaft's SpatialSignatureAnalysis.clustergram): for every k each row's cluster and the mean of its cluster, the cluster's centre projected on the first principal axis (pca_weighted) or averaged over the metrics.
| Input | Type | What it is |
tablerequired | table | the signatures (metrics.signatures) or any metrics |
| Output | Type | What it is |
labels | table | per row: its keys and its cluster at each k (k1, k2...) |
means | table | per row: its keys and its cluster's mean at each k |
| Setting | Type | What it is |
columns | any | the metrics (default every column but the keys: zone, landscape, class, date...) |
method | text | kmeans (default; k-means++ starts, the best of n_init) or a linkage: ward, average, complete, single, centroid, median, weighted |
components | integer | cluster the first principal components, not the metrics |
n_init | integer | k-means: the starts (default 10) |
seed | integer | k-means: numpy's seed (default 0) |
k_min | integer | the fewest clusters (default 1) |
k_max | integer | the most clusters (default 8) |
pca_weighted | bool | the means on the first principal axis (default true) |
metrics.correlation
The correlation between the metrics of a table (its columns, over its rows), as landscapemetrics' calculate_correlation: R's cor, Pearson's, Spearman's or Kendall's, the same values. A metric with NA values has NA correlations (but its own, 1). Rows without a class are left out.
| Input | Type | What it is |
tablerequired | table | the metrics, e.g. of metrics.patch or metrics.class |
| Output | Type | What it is |
table | table | the correlation matrix: a row and a column per metric |
| Setting | Type | What it is |
method | text | pearson (default), spearman or kendall |
columns | any | the metrics (default every column but the keys: class, patch, plot_id, size, zone, date...) |
metrics.landscape
Landscape metrics of the whole map, as landscapemetrics and FRAGSTATS: diversity (shdi, sidi...), contagion, edge density, aggregation, the patches' metrics summarised... A table of one row.
| Input | Type | What it is |
maprequired | raster | the map of classes (or rasters on disk, by blocks) |
| Output | Type | What it is |
table | table | the metrics |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
block_rows | integer | out of core: the map read by blocks of this many rows (a multiple of 64), the same metrics; rasters on disk of more than 250 million cells always are |
metrics.nmf
Non-negative factors of spatial signatures (landschaft's SpatialSignatureAnalysis.nmf): each metric scaled to [0, 1] (constant ones left out), approximated by scores times components, both non-negative (NNDSVDa start, HALS sweeps; scikit-learn's NMF(init="nndsvda", solver="cd")).
| Input | Type | What it is |
tablerequired | table | the signatures (metrics.signatures) or any metrics |
| Output | Type | What it is |
scores | table | per row: its keys and its factors (NMF1, NMF2...) |
components | table | per factor: the weights of the metrics |
error | number | the Frobenius norm of the residual |
iterations | integer | the sweeps made |
| Setting | Type | What it is |
columns | any | the metrics (default every column but the keys: zone, landscape, class, date...) |
factorsrequired | integer | the number of factors |
max_iter | integer | the most sweeps (default 1000) |
tol | number | stop when the loss improves by less (relative; 1e-6) |
metrics.patch
Landscape metrics of every patch (the cells of a class connected to one another), as landscapemetrics and FRAGSTATS: area, perimeter, shape, core, nearest neighbour... A table of a row per patch (its class and number, then the metrics), the map of the patches, and the map of one metric if asked for.
| Input | Type | What it is |
maprequired | raster | the map of classes (or rasters on disk, by blocks) |
| Output | Type | What it is |
table | table | per patch: its class, its number and the metrics |
patches | map | each cell's patch, by number (of a map in memory, or written to patches_path) |
map | map | the metric shown (show) on each patch, of a map in memory |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
block_rows | integer | out of core: the map read by blocks of this many rows (a multiple of 64), the same metrics; rasters on disk of more than 250 million cells always are |
patches_path | text | rasters on disk by blocks: the GeoTIFF the patches are written to, block by block |
show | text | a metric of the level to give as a map |
metrics.pca
The principal components of spatial signatures (landschaft's SpatialSignatureAnalysis.pca): the metrics as z-scores (constant ones left out, rows with NA too), their singular value decomposition, each component's largest loading positive.
| Input | Type | What it is |
tablerequired | table | the signatures (metrics.signatures) or any metrics |
| Output | Type | What it is |
scores | table | per row: its keys and its scores (PC1, PC2...) |
loadings | table | per component: its share of the variance (explained) and the loadings of the metrics |
| Setting | Type | What it is |
columns | any | the metrics (default every column but the keys: zone, landscape, class, date...) |
components | integer | the components kept (default all) |
metrics.sample
Landscape metrics of sample plots, as landscapemetrics' sample_lsm and scale_sample: squares or circles (100 vertices) of a size around points, or polygons as they are. Each plot is cut from the map as terra's crop(mask = TRUE): the window snapped to the nearest cells' edges, the cells the plot touches kept, the others NA; its metrics those of a landscape of its own. Several sizes give a row per size. The % of each plot's area that has cells of the map (its area geodesic when the plots' coordinate system is known, as landscapemetrics).
| Input | Type | What it is |
maprequired | raster | the map of classes (or rasters on disk, read plot by plot) |
plotsrequired | vector | points (buffers around them) or polygons |
| Output | Type | What it is |
table | table | per plot (and size, class or patch): plot_id, size, class, patch, percentage_inside, the metrics |
plots | vector | the plots measured, with plot_id (and size) |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
level | text | landscape (default), class or patch |
size | any | points: the buffer's half side or radius, or a list of them |
shape | text | points: square (default) or circle buffers |
id_column | text | the plots' identifiers (default 1, 2...) |
all_classes | bool | class level: a row (NA) for every class of the map that a plot lacks, and for NA when the map has it |
block_rows | integer | out of core: each plot's window read alone from the rasters on disk (always beyond 250 million cells), the map's classes by blocks of this many rows |
metrics.series
Landscape metrics along a series of maps (a layer per date), as pylandstats' SpatioTemporalAnalysis in landschaft: of the whole maps, of zones (polygons), of buffers around points or of square zones tiling the maps (grid). Landscape level: a row per (zone and) date; class level: a row per class, (zone and) date, every class at every date, 0 instead of NA for the area, edge and count metrics of a class absent (fillna).
| Input | Type | What it is |
mapsrequired | raster | the maps of classes, a layer per date (or rasters on disk) |
plots | vector | zones (polygons) or points (buffers around them) |
| Output | Type | What it is |
table | table | per (class,) (zone and) date: the metrics |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
level | text | landscape (default) or class |
dates | any | the layers' dates (default: their keys, or 1, 2...) |
grid | number | zones: squares of this side tiling the maps |
size | number | points: the buffer's half side or radius |
shape | text | points: square (default) or circle buffers |
fillna | bool | class level: 0 for absent classes' counts (default true) |
block_rows | integer | out of core: whole maps read by blocks of this many rows, zones window by window from the rasters on disk (always beyond 250 million cells), the same metrics |
metrics.signatures
Spatial signatures, as pylandstats' SpatialSignatureAnalysis in landschaft: landscapes described by their metrics, a row per zone of a map (polygons, buffers around points or a grid of squares) or per layer of a stack, a column per landscape metric and per class metric and class (pland_11...), in alphabetical order. For metrics.pca, metrics.nmf, metrics.cluster and metrics.clustergram.
| Input | Type | What it is |
mapsrequired | raster | a map of classes (its zones) or a stack (a row per layer), or rasters on disk |
plots | vector | zones (polygons) or points (buffers around them) |
| Output | Type | What it is |
table | table | per zone (or landscape): the metrics |
| Setting | Type | What it is |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
landscape_metrics | any | landscape metrics (a name or a list: shdi, ed...) |
class_metrics | any | class metrics, a column per class (pland...) |
classes | any | the classes of the class metrics (default all) |
grid | number | zones: squares of this side tiling the map |
size | number | points: the buffer's half side or radius |
shape | text | points: square (default) or circle buffers |
fillna | bool | 0 for absent classes' counts and areas (default true) |
block_rows | integer | out of core: whole maps read by blocks of this many rows, zones window by window from the rasters on disk (always beyond 250 million cells), the same metrics |
metrics.window
Landscape-level metrics in a moving window, as landscapemetrics' window_lsm: for every cell, the metrics of the landscape the window centred on it covers (cells outside the map are NA). A map per metric, in a stack. Out of core (block_rows, or rasters on disk) by strips of rows with the window's half side above and below, the same maps; those of rasters on disk written to a GeoTIFF, a band per metric.
| Input | Type | What it is |
maprequired | raster | the map of classes (or rasters on disk, by blocks) |
| Output | Type | What it is |
maps | raster | a map per metric, by its name (on disk for rasters on disk) |
| Setting | Type | What it is |
metrics | any | the metrics (a name or a list: ca, pland, np...; default all of the level) |
type | text | without metrics, those of a type: area and edge, shape, core area, aggregation, diversity, complexity, contrast |
extras | bool | without metrics, FRAGSTATS' that landscapemetrics lacks too |
directions | integer | the patches' connectivity: 8 (default) or 4 |
count_boundary | bool | the map's boundary counts as edge (default false) |
consider_boundary | bool | cells at the boundary can be core (default false) |
edge_depth | integer | core areas: the edge's depth in cells (default 1) |
cell_center | bool | gyrate: the centroid on a cell of the patch |
classes_max | number | rpr: the most classes there could be |
neighbourhood | integer | complexity metrics: 4 (default) or 8 neighbours |
ordered | bool | complexity metrics: ordered pairs (default true) |
base | text | complexity metrics' logarithm: log2 (default), log or log10 |
convention | text | landscapemetrics (default) or fragstats (physical edge lengths, disjunct cores' sizes) |
search_radius | number | prox, simi: the search radius (map units) |
connect_threshold | number | connect: the distance of a connection |
boundary_contrast | number | econ, cwed, teci: the weight of edges to NA |
contrast | any | econ, cwed, teci: [class a, class b, weight] of each edge |
similarity | any | simi: [class a, class b, weight] of each pair |
block_rows | integer | out of core: the map read by blocks of this many rows, the same metrics; rasters on disk of more than 250 million cells always are |
window | integer | the window's side in cells, odd (default 5) |
shape | text | square (default) or circle (the cells within side/2) |
path | text | rasters on disk: the GeoTIFF written (default next to the input: name_window5.tif) |