# NOT RUN {
-=-
# --- Access to the Brazil Data Cube
# Provide your BDC credentials as environment variables
Sys.setenv(
"BDC_ACCESS_KEY" = <your_bdc_access_key>
)
# create a raster cube file based on the information in the BDC
cbers_tile <- sits_cube(
source = "BDC",
collection = "CB4_64_16D_STK-1",
name = "cbers_022024",
bands = c("NDVI", "EVI"),
tiles = "022024",
start_date = "2018-09-01",
end_date = "2019-08-28"
)
# --- Create a WTSS cube from BDC cubes
# Provide your BDC credentials as environment variables
Sys.setenv(
"BDC_ACCESS_KEY" = <your_bdc_access_key>
)
cube_wtss <- sits::sits_cube(source = "WTSS",
collection = "MOD13Q1-6")
# --- Access to Digital Earth Africa
# 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>
)
# create a raster cube file based on the information about the files
cube_dea <- sits_cube(source = "DEAFRICA",
name = "deafrica_cube",
collection = "s2_l2a",
bands = c("B04", "B08"),
bbox = c("xmin" = 17.379,
"ymin" = 1.1573,
"xmax" = 17.410,
"ymax" = 1.1910),
start_date = "2019-01-01",
end_date = "2019-10-28")
# --- Access to Sentinel 2/2A level 2 data in AWS
# 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>
)
s2_cube <- sits_cube(source = "AWS",
name = "T20LKP_2018_2019",
collection = "sentinel-s2-l2a",
tiles = c("20LKP","20LLP"),
start_date = as.Date("2018-07-18"),
end_date = as.Date("2018-07-23"),
s2_resolution = 20
)
# --- Create a cube based on a stack of CBERS data
data_dir <- system.file("extdata/raster/cbers", package = "sits")
cbers_cube <- sits_cube(
source = "LOCAL",
name = "022024",
satellite = "CBERS-4",
sensor = "AWFI",
data_dir = data_dir,
delim = "_",
parse_info = c("X1", "X2", "tile", "band", "date")
)
# Create a raster cube based on files with probability information
# inform the files that make up a raster probs brick with 23 time instances
probs_file <- c(system.file(
"extdata/raster/probs/sinop-2014_probs_2013_9_2014_8_v1.tif",
package = "sits"
))
# inform the labels
labels <- c("Cerrado", "Fallow_Cotton", "Forest", "Pasture", "Soy_Corn",
"Soy_Cotton", "Soy_Fallow", "Soy_Millet", "Soy_Sunflower")
# create a raster cube file based on the information about the files
probs_cube <- sits_cube(
source = "PROBS",
name = "Sinop-crop-probs",
satellite = "TERRA",
sensor = "MODIS",
start_date = as.Date("2013-09-14"),
end_date = as.Date("2014-08-29"),
probs_labels = labels,
probs_files = probs_file
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab