Skip to contents

get_nlcd_annual returns a SpatRaster of NLCD data cropped to a given template study area. The Annual NLCD is currently only available for the conterminous United States. More information about the Annual NLCD product is available on the Annual NLCD web page.

Usage

get_nlcd_annual(
  template,
  label,
  year = 2023,
  product = "LndCov",
  region = "CU",
  collection = 1,
  version = 0,
  extraction.dir = file.path(tempdir(), "FedData", "extractions", "nlcd_annual", label),
  raster.options = c("COMPRESS=DEFLATE", "ZLEVEL=9"),
  force.redo = FALSE
)

Arguments

template

An Simple Feature or terra object to serve as a template for cropping.

label

A character string naming the study area.

year

An integer vector representing the year of desired NLCD product. Acceptable values are currently 1985 through 2023 (defaults to 2023).

product

A character vector representing type of the NLCD product. Defaults to 'LndCov' (Land Cover).
LndCov = Land Cover
LndChg = Land Cover Change
LndCnf = Land Cover Confidence
FctImp = Fractional Impervious Surface
ImpDsc = Impervious Descriptor
SpcChg = Spectral Change Day of Year

region

A character string representing the region to be extracted Acceptable values are 'CU' (Conterminous US, the default), 'AK' (Alaska), and 'HI' (Hawaii). Currently, only 'CU' is available.

collection

An integer representing the collection number. Currently, only '1' is available.

version

An integer representing the version number. Currently, only '0' is available.

extraction.dir

A character string indicating where the extracted and cropped NLCD data should be put. The directory will be created if missing.

raster.options

a vector of GDAL options passed to terra::writeRaster.

force.redo

If an extraction for this template and label already exists, should a new one be created?

Value

A RasterLayer cropped to the bounding box of the template.

Examples

# \donttest{
# Extract data for the Mesa Verde National Park:

# Get the NLCD (USA ONLY)
# Returns a raster
NLCD_ANNUAL <-
  get_nlcd_annual(
    template = FedData::meve,
    label = "meve",
    year = 2020,
    product =
      c(
        "LndCov",
        "LndChg",
        "LndCnf",
        "FctImp",
        "ImpDsc",
        "SpcChg"
      )
  )
  
  NLCD_ANNUAL
#> # A tibble: 6 × 7
#> # Rowwise: 
#>   product  year region collection version outfile             rast              
#>   <ord>   <int> <ord>       <int>   <int> <glue>              <list>            
#> 1 LndCov   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
#> 2 LndChg   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
#> 3 LndCnf   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
#> 4 FctImp   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
#> 5 ImpDsc   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
#> 6 SpcChg   2020 CU              1       0 /tmp/RtmpYzxfyX/Fe… <SpatRstr[,627,1]>
# }