This function is called by the cov_nightlight module and downloads annual data on night time illumination from NASA (product ID VNP46A4) using the blackmarbler package. You must obtain and a token from NASA to use this function and set an environmental variable called NASA_bearer to contain it. It returns a SpatRaster for the selected area and year.

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{
raster <- cov_nightlight("LIE", 2022)
} # }