get_ned: Download and crop the 1 (~30 meter) or 1/3 (~10 meter)...

View source: R/NED_FUNCTIONS.R

get_nedR Documentation

Download and crop the 1 (~30 meter) or 1/3 (~10 meter) arc-second National Elevation Dataset.

Description

get_ned returns a SpatRaster of elevation data cropped to a given template study area.

Usage

get_ned(
  template,
  label,
  res = "1",
  extraction.dir = file.path(tempdir(), "FedData", "extractions", "ned", label),
  raster.options = c("COMPRESS=DEFLATE", "ZLEVEL=9"),
  force.redo = FALSE
)

Arguments

template

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

label

A character string naming the study area.

res

A character string representing the desired resolution of the NED. '1' indicates the 1 arc-second NED (the default), while '13' indicates the 1/3 arc-second dataset.

extraction.dir

A character string indicating where the extracted and cropped DEM 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 SpatRaster DEM cropped to the extent of the template.

Examples

## Not run: 
# Get the NED (USA ONLY)
# Returns a `SpatRaster`
NED <-
  get_ned(
    template = FedData::meve,
    label = "meve"
  )

# Plot with terra::plot
plot(NED)

## End(Not run)

ropensci/FedData documentation built on April 12, 2024, 11:44 a.m.