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)

Arguments

shape

sf. sf object containing the area of interest

path_df

data.frame. Containing datapath and name columns of the file(s) to be uploaded.

logger

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

Value

a list containing SpatRaster objects

Author

Simon Smart simon.smart@cantab.net

Examples

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)