This function is called by the cov_access module and downloads data on accessibility using data from the Malaria Atlas Project.

cov_access(shape, layer, async = FALSE)

Arguments

shape

sf. sf object containing the area of interest

layer

character. The layer to be returned - one of: Travel Time to Cities (2015), Motorized Travel Time to Healthcare (2020) or Walking Only Travel Time to Healthcare (2020)

async

logical. Whether or not the function is being used asynchronously

Value

a SpatRaster object

Author

Simon Smart simon.smart@cantab.net

Examples

x_min <- 0
x_max <- 0.5
y_min <- 52
y_max <- 52.5
poly_matrix <- matrix(c(x_min, x_min, x_max, x_max, x_min,
                        y_min, y_max, y_max, y_min, y_min), ncol = 2)
poly <- sf::st_polygon(list(poly_matrix))
shape <- sf::st_sf(1, geometry = list(poly))
sf::st_crs(shape) = 4326
raster <- cov_access(shape = shape,
                     layer = "Travel Time to Cities (2015)")
#> Checking if the following Surface-Year combinations are available to download:
#> 
#>     DATASET ID  YEAR 
#>   - Accessibility__201501_Global_Travel_Time_to_Cities:  DEFAULT 
#> 
#> Loading required package: sp
#> Loading required package: sf
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is FALSE
#> No encoding supplied: defaulting to UTF-8.
#> <GMLEnvelope>
#> ....|-- lowerCorner: 52 0
#> ....|-- upperCorner: 52.5 0.5Start tag expected, '<' not found