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(path_df, shape, logger = NULL)

Arguments

path_df

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

shape

sf. sf object containing the area of interest

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(path_df = cov_df, shape = shape)