unionHUC: Union HUC

View source: R/unionHUC.R

unionHUCR Documentation

Union HUC

Description

Aggregates geometry for a set of HUCs.

Usage

unionHUC(huc, upstreamHUCs, hucPoly)

Arguments

huc

The huc in question

upstreamHUCs

A list of HUCs to be aggregated into one geometry

hucPoly

An imported shapefile with all the HUC geometry

Value

An aggregated polygon

Author(s)

David Blodgett dblodgett@usgs.gov

Examples

## Not run: 
load(system.file("extdata","testhucpoly.rda",package="HUCAgg"))
plot(testhucPoly)
hucList<-testhucPoly@data$HUC12
fromHUC<-sapply(hucList,fromHUC_finder,hucs=testhucPoly@data$HUC12,tohucs=testhucPoly@data$TOHUC)
aggrHUCs<-sapply(hucList, HUC_aggregator, fromHUC=fromHUC)
huc<-"070900020904"
outhucPoly<-unionHUC(huc, aggrHUCs, testhucPoly)
plot(outhucPoly, add=TRUE, col=rgb(1,0,0,.3))
outhucPoly@data$AREAACRES

## End(Not run)


USGS-R/HUCAgg documentation built on Nov. 24, 2022, 4:36 a.m.