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 som_map
sits_view(
x,
...,
label,
prob_max = 1,
prob_min = 0.7,
legend = NULL,
palette = "Harmonic"
)
# S3 method for raster_cube
sits_view(
x,
...,
band = NULL,
red = NULL,
green = NULL,
blue = NULL,
tiles = NULL,
dates = NULL,
class_cube = NULL,
legend = NULL,
palette = "default"
)
# S3 method for class_cube
sits_view(x, ..., tiles = NULL, legend = NULL, palette = "default")
# S3 method for probs_cube
sits_view(x, ...)
# 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", "raster_cube" or "classified image".
Further specifications for sits_view.
Named vector that associates labels to colors.
Palette provided in the configuration file.
Label from the SOM map to be shown.
Maximum a posteriori probability for SOM neuron samples to be shown
Minimum a posteriori probability for SOM neuron samples 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.
Gilberto Camara, gilberto.camara@inpe.br
if (sits_run_examples()) {
sits_view(cerrado_2classes)
data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
modis_cube <- sits_cube(
source = "BDC",
collection = "MOD13Q1-6",
data_dir = data_dir,
parse_info = c("X1", "tile", "band", "date")
)
# get the timeline
timeline <- sits_timeline(modis_cube)
# view the data cube
sits_view(modis_cube,
band = "NDVI",
dates = timeline[[1]]
)
# train a model
rf_model <- sits_train(samples_modis_ndvi, sits_rfor())
modis_probs <- sits_classify(
data = modis_cube,
ml_model = rf_model,
output_dir = tempdir(),
memsize = 4,
multicores = 1
)
modis_label <- sits_label_classification(modis_probs,
output_dir = tempdir()
)
sits_view(modis_label)
sits_view(modis_cube,
band = "NDVI",
class_cube = modis_label,
dates = sits_timeline(modis_cube)[[1]]
)
}
Run the code above in your browser using DataLab