mosaic_analyze_iter | R Documentation |
High-resolution mosaics can take a significant amount of time to analyze,
especially when segment_individuals = TRUE
is used in mosaic_analyze().
This is because the function needs to create in-memory arrays to segment
individual using the watershed algorithm. This process utilizes a for-loop
approach, iteratively analyzing each shape within the mosaic one at a time.
To speed up processing, the function crops the original mosaic to the extent
of the current shape before analyzing it. This reduces the resolution for
that specific analysis, sacrificing some detail for faster processing.
mosaic_analyze_iter(
mosaic,
shapefile,
basemap = NULL,
r = 3,
g = 2,
b = 1,
re = NA,
nir = NA,
swir = NA,
tir = NA,
plot = TRUE,
verbose = TRUE,
max_pixels = 3e+06,
attribute = NULL,
summarize_fun = "mean",
segment_plot = FALSE,
segment_individuals = FALSE,
segment_index = "VARI",
plot_index = "VARI",
color_regions = rev(grDevices::terrain.colors(50)),
alpha = 0.75,
quantiles = c(0, 1),
...
)
mosaic |
A mosaic of class |
shapefile |
An optional shapefile containing regions of interest (ROIs) for analysis. |
basemap |
An optional basemap generated with |
r , g , b , re , nir , swir , tir |
The red, green, blue, red-edge, near-infrared, shortwave Infrared, and thermal infrared bands of the image, respectively. By default, the function assumes a BGR as input (b = 1, g = 2, r = 3). If a multispectral image is provided up to seven bands can be used to compute built-in indexes. There are no limitation of band numbers if the index is computed using the band name. |
plot |
Logical, indicating whether to generate plots (default: TRUE). |
verbose |
Logical, indicating whether to display verbose output (default: TRUE). |
max_pixels |
Maximum number of pixels to render in the map or plot (default: 500000). |
attribute |
The attribute to be shown at the plot when |
summarize_fun |
The function to compute summaries for the pixel values. Defaults to "mean," i.e., the mean value of the pixels (either at a plot- or individual-level) is returned. |
segment_plot |
Logical, indicating whether to segment plots (default:
FALSE). If |
segment_individuals |
Logical, indicating whether to segment individuals
within plots (default: FALSE). If |
segment_index |
The index used for segmentation. The same rule as
|
plot_index |
The index(es) to be computed for the drawn plots. Either a
single vegetation index (e.g., |
color_regions |
The color palette for regions (default: rev(grDevices::terrain.colors(50))). |
alpha |
opacity of the fill color of the raster layer(s). |
quantiles |
the upper and lower quantiles used for color stretching. |
... |
Further arguments passed on to |
A list containing the following objects:
result_plot
: The results at a plot level.
result_plot_summ
: The summary of results at a plot level. When
segment_individuals = TRUE
, the number of individuals, canopy coverage,
and mean values of some shape statistics such as perimeter, length, width,
and diameter are computed.
result_individ
: The results at an individual level.
map_plot
: An object of class mapview
showing the plot-level results.
map_individual
: An object of class mapview
showing the individual-level
results.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.