mosaic_view | R Documentation |
Mosaic View
mosaic_view(
mosaic,
r = 3,
g = 2,
b = 1,
edit = FALSE,
title = "",
shapefile = NULL,
attribute = NULL,
viewer = c("mapview", "base"),
show = c("rgb", "index"),
index = "B",
max_pixels = 1e+06,
downsample = NULL,
downsample_fun = "nearest",
alpha = 1,
quantiles = c(0, 1),
color_regions = custom_palette(c("red", "yellow", "forestgreen")),
axes = FALSE,
...
)
mosaic |
A mosaic of class |
r , g , b |
The layer for the Red, Green and Blue band, respectively.
Defaults to |
edit |
If |
title |
A title for the generated map or plot (default: ""). |
shapefile |
An optional shapefile of class |
attribute |
The attribute name(s) or column number(s) in shapefile table of the column(s) to be rendered. |
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 |
downsample_fun |
The resampling function. Defaults to nearest. See further details in |
alpha |
opacity of the fill color of the raster layer(s). |
quantiles |
the upper and lower quantiles used for color stretching. |
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.