This function is called by the cov_nightlight module and downloads annual data on night time illumination from Worldpop

cov_nightlight(shape, country_code, year, async = FALSE)

Arguments

shape

sf. sf object containing the area of interest

country_code

vector. ISO3 code of the country or countries.

year

numeric. Year for which to download the data. Limited to 2015-2023

async

Whether or not the function is being used asynchronously. When TRUE the returned object is a wrapped SpatRaster.

Value

a SpatRaster object when async is FALSE or a PackedSpatRaster when async is TRUE.

Author

Simon Smart simon.smart@cantab.net

Examples

if (FALSE) { # \dontrun{
df_path <- system.file("extdata", "lie.csv", package = "disagapp")
df <- read.csv(df_path)
lie_shape <- resp_download(df, "area", "response", "LIE", "ADM1")
raster <- cov_nightlight(lie_shape, "LIE", 2022)
} # }