# NOT RUN {
{
# }
# NOT RUN {
# --- Access to the AWS STAC
# Provide your AWS credentials as environment variables
Sys.setenv(
"AWS_ACCESS_KEY_ID" = <your_aws_access_key>,
"AWS_SECRET_ACCESS_KEY" = <your_aws_secret_access_key>
)
# define an AWS data cube
s2_cube <- sits_cube(source = "AWS",
name = "T20LKP_2018_2019",
collection = "sentinel-s2-l2a",
bands = c("B08", "SCL"),
tiles = c("20LKP"),
start_date = as.Date("2018-07-18"),
end_date = as.Date("2018-08-18"),
s2_resolution = 60
)
# create a directory to store the resulting images
dir.create(paste0(tempdir(),"/images/"))
# Build a data cube of equal intervals using the "gdalcubes" package
gc_cube <- sits_regularize(cube = s2_cube,
name = "T20LKP_2018_2019_1M",
dir_images = paste0(tempdir(),"/images/"),
period = "P1M",
agg_method = "median",
resampling = "bilinear",
cloud_mask = TRUE)
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataLab