if (sits_run_examples()) {
# reading a shapefile from BDC (Brazil Data Cube)
bdc_cube <- sits_cube(
source = "BDC",
collection = "CBERS-WFI-16D",
bands = c("NDVI", "EVI"),
tiles = c("007004", "007005"),
start_date = "2018-09-01",
end_date = "2018-10-28"
)
# define a shapefile to be read from the cube
shp_file <- system.file("extdata/shapefiles/bdc-test/samples.shp",
package = "sits"
)
# read a shapefile into an sf object
sf_object <- sf::st_read(shp_file)
# get samples from the BDC using an sf object
time_series_bdc <- sits_get_data(
cube = bdc_cube,
samples = sf_object
)
}
Run the code above in your browser using DataLab