Last chance! 50% off unlimited learning
Sale ends in
Uses leaflet to visualize time series, raster cube and classified images
sits_view(x, ...)# S3 method for sits
sits_view(x, ..., legend = NULL, palette = "Harmonic")
# S3 method for data.frame
sits_view(x, ..., legend = NULL, palette = "Harmonic")
# S3 method for som_map
sits_view(x, ..., id_neurons, legend = NULL, palette = "Harmonic")
# S3 method for raster_cube
sits_view(
x,
...,
band = NULL,
red = NULL,
green = NULL,
blue = NULL,
tiles = x[["tile"]],
dates = NULL,
class_cube = NULL,
legend = NULL,
palette = "RdYlGn",
opacity = 0.7
)
# S3 method for vector_cube
sits_view(
x,
...,
band = NULL,
red = NULL,
green = NULL,
blue = NULL,
tiles = x[["tile"]],
dates = NULL,
class_cube = NULL,
legend = NULL,
palette = "RdYlGn",
opacity = 0.7,
seg_color = "black",
line_width = 1
)
# S3 method for uncertainty_cube
sits_view(
x,
...,
tiles = x[["tile"]],
class_cube = NULL,
legend = NULL,
palette = "Blues",
opacity = 0.7
)
# S3 method for class_cube
sits_view(
x,
...,
tiles = x[["tile"]],
legend = NULL,
palette = "Spectral",
opacity = 0.8
)
# S3 method for probs_cube
sits_view(
x,
...,
tiles = x[["tile"]],
class_cube = NULL,
legend = NULL,
opacity = 0.7,
palette = "YlGnBu"
)
# S3 method for default
sits_view(x, ...)
A leaflet object containing either samples or data cubes embedded in a global map that can be visualized directly in an RStudio viewer.
Object of class "sits", "data.frame", "som_map", "raster_cube" or "classified image".
Further specifications for sits_view.
Named vector that associates labels to colors.
Color palette (if colors not in legend nor in sits default colors)
Neurons from the SOM map to be shown.
For plotting grey images.
Band for red color.
Band for green color.
Band for blue color.
Tiles to be plotted (in case of a multi-tile cube).
Dates to be plotted.
Classified cube to be overlayed on top on image.
Opacity of segment fill or class cube
Color for segment boundaries
Line width for segments (in pixels)
Gilberto Camara, gilberto.camara@inpe.br
if (sits_run_examples()) {
# view samples
sits_view(cerrado_2classes)
# create a local data cube
data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
modis_cube <- sits_cube(
source = "BDC",
collection = "MOD13Q1-6",
data_dir = data_dir
)
# view the data cube
sits_view(modis_cube,
band = "NDVI"
)
# train a model
rf_model <- sits_train(samples_modis_ndvi, sits_rfor())
# classify the cube
modis_probs <- sits_classify(
data = modis_cube,
ml_model = rf_model,
output_dir = tempdir()
)
# generate a map
modis_label <- sits_label_classification(
modis_probs,
output_dir = tempdir()
)
# view the classified map
sits_view(modis_label)
# view the classified map with the B/W image
sits_view(modis_cube,
band = "NDVI",
class_cube = modis_label,
dates = sits_timeline(modis_cube)[[1]]
)
# view the classified map with the RGB image
sits_view(modis_cube,
red = "NDVI", green = "NDVI", blue = "NDVI",
class_cube = modis_label,
dates = sits_timeline(modis_cube)[[1]]
)
# create an uncertainty cube
modis_uncert <- sits_uncertainty(
cube = modis_probs,
output_dir = tempdir()
)
# view the uncertainty cube
sits_view(modis_uncert)
}
Run the code above in your browser using DataLab