cov_upload.Rd
This function is called by the cov_upload module. It loads raster images, checks their projection and transforms them if necessary, checks that they overlap with the area of interest and crops and masks them to the area of interest.
cov_upload(shape, path_df, logger = NULL)
sf. sf object containing the area of interest
data.frame. Containing datapath
and name
columns of the
file(s) to be uploaded.
Stores all notification messages to be displayed in the Log Window. Insert the logger reactive list here for running in shiny, otherwise leave the default NULL
a list containing SpatRaster objects
cov_df <- data.frame(datapath = list.files(system.file("extdata", "covariates",
package="disagapp"), full.names = TRUE),
name = list.files(system.file("extdata", "covariates",
package="disagapp")))
shp_file <- list.files(system.file("extdata", "shapes", package="disagapp"),
pattern = ".shp", full.names = TRUE)
shape <- sf::st_read(shp_file, quiet = TRUE)
rasters <- cov_upload(shape = shape, path_df = cov_df)