Import raster data from the EEA Air Quality Download Service API
Source:R/get_eea_raster.R
get-raster.RdThese functions are wrappers for the 'Raster' endpoints of the European Environment Agency's Air Quality Download Service API.
get_eea_raster_files()downloads a zip file with all the filtered parquet files in it.get_eea_raster_async()prepares this in the background; the function returns an URL in which the file to be downloaded will be generated.
Usage
get_eea_raster_files(
country = NULL,
city = NULL,
pollutants = NULL,
datetime_start = Sys.Date() - 10,
datetime_end = Sys.Date(),
email = NULL,
output_format = "zip",
file = tempfile(fileext = paste0(".", output_format))
)
get_eea_raster_async(
country = NULL,
city = NULL,
pollutants = NULL,
datetime_start = Sys.Date() - 10,
datetime_end = Sys.Date(),
email = NULL,
output_format = "zip",
file = tempfile(fileext = paste0(".", output_format))
)Arguments
- country
A single country code from
import_eea_countries().- city
A single city in the given
countryfromimport_eea_cities(). IfNULL, data from all cities in the givencountrywill be imported.- pollutants
A vector of pollutant IDs from
import_eea_pollutants()(e.g.,"pm10").- datetime_start, datetime_end
Start and end date times, provided as
POSIXct,DateorintegerR objects. If anintegeris provided, this should represent the year of interest; fordatetime_startthis will be represent the first hour of the year and fordatetime_endit will represent the last hour of the year, meaning providing the same integer to each will return a year of data.Optional field to identify the user who make the download and improve the communication if problems are detected.
- output_format
One of
"zip"or"tiff".- file
The file to write the zip file to; should ideally end in
".zip". Defaults to a temporary file usingtempfile().