Convert an SpatRaster object to a Image object with optional scaling.
Arguments
- mosaic
A mosaic of class
SpatRaster, generally imported withmosaic_input().- r
The layer for the Red band (default: 3).
- g
The layer for the Green band (default: 2).
- b
The layer for the Blue band (default: 1).
- re
The layer for the Red-edge band (default: 4).
- nir
The layer for the Near-infrared band(default: 5).
- rescale
Rescale the final values? If
TRUEthe final values are rescaled so that the maximum value is 1.- coef
An addition coefficient applied to the resulting object. This is useful to adjust the brightness of the final image. Defaults to 0.
Details
This function converts SpatRaster into an Image object, which
can be used for image analysis in pliman. Note that if a large
SpatRaster is loaded, the resulting object may increase considerably the
memory usage.
Examples
library(pliman)
# Convert a mosaic raster to an Image object
mosaic <- mosaic_input(system.file("ex/elev.tif", package="terra"))
pliman_image <- mosaic_to_pliman(mosaic)
plot(pliman_image)
