access_grid.Rd
Access to gridded data following the MAS data structure.
access_grid(data_id, range = range, bbox = bbox)
data_id | Element of class character. |
---|---|
range | Two-element vector of class character with desired start and end dates (optional, in yyyy-mm-dd format). |
bbox | Four-element vector with target bounding box, composed of min. x, min. y, max. x and max. y coordinates. |
A spatRaster object
The function provides access to gridded data in the MAS database, returning as a SpatRaster object, native to the terra R package. If range is provided, the function will select data files within the given temporal range and, if bbox is provided, those files will be constrained to the given spatial bounding box. If the query encounters multiple files (i.e. time-series), the output will be a multi-layered spatRaster object. Note that independently of the number of layers in the output, the function time can be used to determine the date to which the given layer corresponds to. However, if the target layer is a composite of multiple dates, this information will be set as NA. Whenever this function is ran, it will look for an existing temporary directory and store virtual rasters (VRT's) corresponding to the read-in layers. The temporary directory is created the first time this function is ran, and its path will be accessible using getOption('rast.temp').
{}#> NULL