get_nhd: Download and crop the National Hydrography Dataset.

Description Usage Arguments Value Examples

View source: R/NHD_FUNCTIONS.R

Description

get_nhd returns a list of Spatial* objects extracted from the National Hydrography Dataset.

Usage

1
2
3
get_nhd(template, label, raw.dir = "./RAW/NHD",
  extraction.dir = paste0("./EXTRACTIONS/", label, "/NHD"),
  force.redo = FALSE)

Arguments

template

A Raster* or Spatial* object to serve as a template for cropping.

label

A character string naming the study area.

raw.dir

A character string indicating where raw downloaded files should be put. The directory will be created if missing. Defaults to './RAW/NHD/'.

extraction.dir

A character string indicating where the extracted and cropped NHD shapefiles should be put. The directory will be created if missing. Defaults to './EXTRACTIONS/NHD/'.

force.redo

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

Value

A list of Spatial* objects extracted from the National Hydrography Dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# Extract data for the Village Ecodynamics Project 'VEPIIN' study area:
# http://village.anth.wsu.edu
vepPolygon <- polygon_from_extent(raster::extent(672800,740000,4102000,4170000), 
     proj4string='+proj=utm +datum=NAD83 +zone=12')

# Get the NHD (USA ONLY)
NHD <- get_nhd(template=vepPolygon, label='VEPIIN')

# Plot the VEP polygon
plot(vepPolygon)

# Plot the NHD data
plot(NHD$NHDFlowline, add=T)
plot(NHD$NHDLine, add=T)
plot(NHD$NHDArea, col='black', add=T)
plot(NHD$NHDWaterbody, col='black', add=T)

## End(Not run)

FedData documentation built on Aug. 19, 2017, 1:02 a.m.