library(rsat)
if (FALSE) {
# load example rtoi
file.copy(from=system.file("ex/Navarre",package="rsat"),
to=tempdir(),
recursive = TRUE)
navarre <- read_rtoi(file.path(tempdir(),"Navarre"))
print(navarre)
# plot the calendar
plot(navarre, "dates")
# replace with your own "username" and "password"
set_credentials("username", "password")
# plot the quicklook images before the download
# needs credentials to download preview images
plot(navarre, y = "preview")
# select partially cloud free
rcds <- records(navarre)
rcds <- rcds[dates(rcds) %in% as.Date(c("20210310", "20210313"), "%Y%m%d")]
records(navarre) <- rcds
plot(navarre, "preview")
file.copy(from=system.file("ex/Pamplona",package="rsat"),
to=tempdir(),
recursive = TRUE)
# plot already mosaicked rtoi ("view" mode)
pamplona <- read_rtoi(file.path(tempdir(),"Pamplona"))
rsat_list_data(pamplona)
# plot can compute the rgb image on the fly from mosaicek bands
plot(pamplona, "view", product="mod09ga")
# plot on the fly with false color
plot(pamplona, "view",
product = "mod09ga",
band_name = c("nir", "red", "green"))
file.copy(from=system.file("ex/PamplonaDerived",package="rsat"),
to=tempdir(),
recursive = TRUE)
# plot already mosaicked rtoi ("view" mode)
pamplona.derived <- read_rtoi(file.path(tempdir(),"PamplonaDerived"))
rsat_list_data(pamplona.derived)
# plot derived variables
plot(pamplona.derived, "view",
product = "mod09ga",
variable = "NDVI")
# Set the max and min value in plot
plot(pamplona.derived,"view",
variable="NDVI",
product="mod09ga",
zlim=c(0,1))
}
Run the code above in your browser using DataLab