Skip to contents

The download_nlcd() function accesses and downloads land cover data from the Multi-Resolution Land Characteristics (MRLC) Consortium's National Land Cover Database (NLCD) products data base.

Usage

download_nlcd(
  collection = "Coterminous United States",
  year = 2021,
  directory_to_save = NULL,
  acknowledgement = FALSE,
  download = FALSE,
  remove_command = FALSE,
  unzip = TRUE,
  remove_zip = FALSE,
  hash = FALSE
)

Arguments

collection

character(1). "Coterminous United States" or "Alaska".

year

integer(1). Available years for Coterminous United States include 2001, 2004, 2006, 2008, 2011, 2013, 2016, 2019, and 2021. Available years for Alaska include 2001, 2011, and 2016.

directory_to_save

character(1). Directory to save data. Two sub-directories will be created for the downloaded zip files ("/zip_files") and the unzipped shapefiles ("/data_files").

acknowledgement

logical(1). By setting TRUE the user acknowledges that the data downloaded using this function may be very large and use lots of machine storage and memory.

download

logical(1). FALSE will generate a *.txt file containing all download commands. By setting TRUE the function will download all of the requested data files.

remove_command

logical(1). Remove (TRUE) or keep (FALSE) the text file containing download commands.

unzip

logical(1). Unzip zip files. Default is TRUE.

remove_zip

logical(1). Remove zip files from directory_to_download. Default is FALSE.

hash

logical(1). By setting TRUE the function will return an rlang::hash_file() hash character corresponding to the downloaded files. Default is FALSE.

Value

  • For hash = FALSE, NULL

  • For hash = TRUE, an rlang::hash_file character.

  • Zip and/or data files will be downloaded and stored in respective sub-directories within directory_to_save.

References

dewitz_national_2023amadeus
dewitz_national_2024amadeus

Author

Mitchell Manware, Insang Song

Examples

if (FALSE) { # \dontrun{
download_nlcd(
  collection = "Coterminous United States",
  year = 2021,
  directory_to_save = tempdir(),
  acknowledgement = TRUE,
  download = FALSE, # NOTE: download skipped for examples,
  remove_command = TRUE,
  unzip = FALSE
)
} # }