unionHUCSet: Union HUC Set

Description Usage Arguments Value Author(s) Examples

View source: R/unionHUCSet.R

Description

Aggregates geometry for a large collection of HUCs. Note that subhucPoly must be all potential HUCs required.

Usage

1
unionHUCSet(aggrHUCs, fromHUCs, subhucPoly)

Arguments

aggrHUCs

The list of aggregate HUCs to be processed per HUC_aggregator

fromHUCs

The list of 'fromHUCs' to be processed per fromHUC_finder

subhucPoly

A subset of HUCs for the region in questioned.

Value

The subhucPoly data frame with requested aggregated HUCs unioned together. Note that Polygon 'ID's are set to the HUC id and areas are added up appropriately.

Author(s)

David Blodgett dblodgett@usgs.gov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)
testhucPoly<-unionHUCSet(aggrHUCs, fromHUC, testhucPoly)
plot(subset(testhucPoly,testhucPoly@data$HUC12 %in% "070900020904"), add=TRUE, col=rgb(1,0,0,.3))
plot(subset(testhucPoly,testhucPoly@data$HUC12 %in% "070900020702"), add=TRUE, col=rgb(1,1,0,.3))

## End(Not run)

jread-usgs/HUCAgg documentation built on May 20, 2019, 10:45 a.m.