Learn R Programming

FedData (version 4.0.1)

get_nass_cdl: Download and crop the NASS Cropland Data Layer.

Description

get_nass_cdl returns a SpatRaster of NASS Cropland Data Layer cropped to a given template study area.

Usage

get_nass_cdl(
  template,
  label,
  year = 2019,
  extraction.dir = paste0(tempdir(), "/FedData/"),
  raster.options = c("COMPRESS=DEFLATE", "ZLEVEL=9", "INTERLEAVE=BAND"),
  force.redo = FALSE,
  progress = TRUE
)

get_nass(template, label, ...)

get_cdl(template, label, ...)

cdl_colors()

Value

A SpatRaster cropped to the bounding box of the template.

Arguments

template

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

label

A character string naming the study area.

year

An integer representing the year of desired NASS Cropland Data Layer product. Acceptable values are 2007--the last year.

extraction.dir

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

raster.options

a vector of options for terra::writeRaster.

force.redo

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

progress

Draw a progress bar when downloading?

...

Other parameters passed on to get_nass_cdl.

Examples

Run this code
if (FALSE) {
# Extract data for the Mesa Verde National Park:

# Get the NASS CDL (USA ONLY)
# Returns a raster
NASS <-
  get_nass_cdl(
    template = FedData::meve,
    label = "meve",
    year = 2011
  )

# Plot with terra::plot
plot(NASS)
}

Run the code above in your browser using DataLab