Skip to contents

Downloads the USFS Fire Occurrence Database (FPA-FOD) GeoPackage ZIP archive from the Forest Service Research Data Archive and unzips it to a local directory. The server requires browser-like request headers, so httr2 is used instead of a simple download helper. If the ZIP already exists and overwrite = FALSE, no network call is made.

Usage

get_fod(
  directory = getwd(),
  overwrite = FALSE,
  timeout = 3600,
  verbose = TRUE,
  dry_run = FALSE
)

Arguments

directory

character(1) directory where the ZIP file and unzipped contents are stored. Defaults to the current working directory.

overwrite

logical(1) re-download when TRUE; defaults to FALSE.

timeout

numeric(1) download timeout in seconds. Defaults to 3600 (one hour).

verbose

logical(1) print progress messages.

dry_run

logical(1) if TRUE, do not download the file but instead return the path where it would be saved. Defaults to FALSE.

Value

character(1) path to the downloaded ZIP file (invisibly).

Warning [large files]

The FOD ZIP archive is approximately 175 MB. Downloads may be slow depending on connection speed. Consider downloading in a background session if needed.

Examples

if (FALSE) { # \dontrun{
zip_path <- get_fod()
zip_path <- get_fod(directory = "data/fod")
} # }