simplifyHucs | R Documentation |
A convenience function to help simplify very large aggregate HUCs.
simplifyHucs(subhucPoly, coordThresh = 50000, simpTol = 5e-05)
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. |
data.frame
The subhucPoly data frame with large polygons simplified.
David Blodgett dblodgett@usgs.gov
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.