simplifyHucs: Simplify HUCs

View source: R/simplifyHucs.R

simplifyHucsR Documentation

Simplify HUCs

Description

A convenience function to help simplify very large aggregate HUCs.

Usage

simplifyHucs(subhucPoly, coordThresh = 50000, simpTol = 5e-05)

Arguments

subhucPoly

A subset of HUCs for the region in questioned.

coordThresh

A threshold number of nodes above which polygons will be simplified.

simpTol

A tolerance to pass into the Douglas-Peuker algorith.

Value

data.frame The subhucPoly data frame with large polygons simplified.

Author(s)

David Blodgett dblodgett@usgs.gov

Examples

## Not run: 
load(system.file("extdata","testhucpoly.rda",package="HUCAgg"))
hucList<-testhucPoly@data$HUC12
fromHUC<-sapply(hucList,fromHUC_finder,hucs=testhucPoly@data$HUC12,tohucs=testhucPoly@data$TOHUC)
aggrHUC<-sapply(hucList, HUC_aggregator, fromHUC=fromHUC)
testhucPoly<-unionHUCSet(aggrHUC, fromHUC, testhucPoly)
plot(subset(testhucPoly,testhucPoly@data$HUC12 %in% "070900020504"))
testhucPoly<-simplifyHucs(testhucPoly,coordThresh=0,simpTol = 1e-2)
plot(subset(testhucPoly,testhucPoly@data$HUC12 %in% "070900020504"), add=TRUE)

## End(Not run)


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