| sits_regularize {sits} | R Documentation |
Creates cubes with regular time intervals using the gdalcubes package. Cubes can be composed using "min", "max", "mean", "median" or "first" functions. Users need to provide an time interval which is used by the composition function.
sits_regularize( cube, output_dir, period, res, roi = NULL, agg_method = "least_cc_first", fill_method = "near", resampling = "bilinear", cloud_mask = FALSE, multicores = 2 )
cube |
A |
output_dir |
A |
period |
A |
res |
A |
roi |
A named |
agg_method |
A |
fill_method |
A |
resampling |
A |
cloud_mask |
A |
multicores |
A |
A sits_cube object with aggregated images.
The "roi" parameter defines a region of interest. It can be an sf_object, a shapefile, or a bounding box vector with named XY values ("xmin", "xmax", "ymin", "ymax") or named lat/long values ("lat_min", "lat_max", "long_min", "long_max")
The least_cc_first aggregation method sorts the images based on
cloud coverage, images with the least clouds are at the top of the stack.
Once the stack of images is sorted the method uses the first valid value
to generate the temporal aggregation.
If the supplied data cube contains cloud band, the values indicated as clouds or cloud shadow will be removed.
APPEL, Marius; PEBESMA, Edzer. On-demand processing of data cubes from satellite image collections with the gdalcubes library. Data, v. 4, n. 3, p. 92, 2019. DOI: 10.3390/data4030092.
Ferreira, Karine R., et al. "Earth observation data cubes for Brazil: Requirements, methodology and products." Remote Sensing 12.24 (2020): 4033. DOI: 10.3390/rs12244033.
{
## Not run:
# --- Access to the AWS STAC
# define an AWS data cube
s2_cube <- sits_cube(source = "AWS",
collection = "sentinel-s2-l2a-cogs",
bands = c("B08", "SCL"),
tiles = c("20LKP"),
start_date = as.Date("2018-07-18"),
end_date = as.Date("2018-08-18")
)
# 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,
output_dir = paste0(tempdir(),"/images/"),
period = "P1M",
res = 320)
## End(Not run)
}