mosaic_view | R Documentation |
Mosaic View
mosaic_view(
mosaic,
r = 3,
g = 2,
b = 1,
re = 4,
nir = 5,
title = "",
viewer = c("mapview", "base"),
show = c("rgb", "index"),
index = "B",
max_pixels = 5e+05,
downsample = NULL,
alpha = 1,
quantiles = c(0, 1),
domain = NULL,
color_regions = custom_palette(),
axes = FALSE,
...
)
mosaic |
A mosaic of class |
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). |
title |
A title for the generated map or plot (default: ""). |
viewer |
The viewer option. If not provided, the value is retrieved
using |
show |
The display option for the map view. Options are "rgb" for RGB view and "index" for index view. |
index |
The index to use for the index view. Defaults to "B". |
max_pixels |
Maximum number of pixels to render in the map or plot (default: 500000). |
downsample |
Downsampling factor to reduce the number of pixels
(default: NULL). In this case, if the number of pixels in the image (width
x height) is greater than |
alpha |
opacity of the fill color of the raster layer(s). |
quantiles |
the upper and lower quantiles used for color stretching. If
set to |
domain |
the upper and lower values used for color stretching. This is
used only if |
color_regions |
The color palette for displaying index values. Default
is |
axes |
logical. Draw axes? Defaults to |
... |
Additional arguments passed on to |
The function can generate either an interactive map using the
'mapview' package or a static plot using the 'base' package, depending on
the viewer
and show
parameters. If show = "index" is used, the function
first computes an image index that can be either an RGB-based index or a
multispectral index, if a multispectral mosaic is provided.
An sf object, the same object returned by mapedit::editMap()
.
if(interactive()){
library(pliman)
# Load a raster showing the elevation of Luxembourg
mosaic <- mosaic_input(system.file("ex/elev.tif", package="terra"))
# Generate an interactive map using 'mapview'
mosaic_view(mosaic)
# Generate a static plot using 'base'
mosaic_view(mosaic, viewer = "base")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.