Prepare an SpatRaster
object to be analyzed in pliman. This includes
cropping the original mosaic, aligning it, and cropping the aligned object.
The resulting object is an object of class Image
that can be further
analyzed.
mosaic_prepare(
mosaic,
r = 3,
g = 2,
b = 1,
re = 4,
nir = 5,
crop_mosaic = FALSE,
align = TRUE,
crop_aligned = TRUE,
rescale = TRUE,
coef = 0,
viewer = "mapview",
max_pixels = 5e+05,
show = "rgb",
index = "R"
)
A prepared object of class Image
.
A mosaic of class SpatRaster
, generally imported with
mosaic_input()
.
The layer for the Red band (default: 3).
The layer for the Green band (default: 2).
The layer for the Blue band (default: 1).
The layer for the Red-edge band (default: 4).
The layer for the Near-infrared band(default: 5).
Logical, whether to crop the mosaic interactively before aligning it (default: FALSE).
Logical, whether to align the mosaic interactively (default: TRUE).
Logical, whether to crop the aligned mosaic interactively (default: TRUE).
Rescale the final values? If TRUE
the final values are
rescaled so that the maximum value is 1.
An addition coefficient applied to the resulting object. This is useful to adjust the brightness of the final image. Defaults to 0.
The viewer option. If not provided, the value is retrieved
using get_pliman_viewer()
. This option controls the type of viewer to use
for interactive plotting. The available options are "base" and "mapview".
If set to "base", the base R graphics system is used for interactive
plotting. If set to "mapview", the mapview package is used. To set this
argument globally for all functions in the package, you can use the
set_pliman_viewer()
function. For example, you can run
set_pliman_viewer("mapview")
to set the viewer option to "mapview" for
all functions.
Maximum number of pixels to render in the map or plot (default: 500000).
The display option for the map view. Options are "rgb" for RGB view and "index" for index view.
The index to use for the index view. Defaults to "B".
if(interactive()){
library(pliman)
mosaic <- mosaic_input(system.file("ex/elev.tif", package="terra"))
mosaic_prepare(mosaic)
}
Run the code above in your browser using DataLab