Skip to content

Commit

Permalink
thin - use polygon names instead of sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmcintire committed Mar 26, 2018
1 parent d77247a commit ef2b30f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ importFrom(data.table,':=')
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,set)
importFrom(data.table,setDT)
importFrom(ggplot2,ggplot)
importFrom(grDevices,as.raster)
importFrom(grDevices,colorRampPalette)
Expand Down Expand Up @@ -132,6 +133,7 @@ importFrom(sp,Polygon)
importFrom(sp,Polygons)
importFrom(sp,SpatialLines)
importFrom(sp,SpatialPolygons)
importFrom(sp,SpatialPolygonsDataFrame)
importFrom(sp,bbox)
importFrom(sp,coordinates)
importFrom(sp,proj4string)
Expand Down
2 changes: 1 addition & 1 deletion R/plotting-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@ thin.SpatialPolygons <- function(x, tolerance = NULL, returnDataFrame = FALSE, m

polyList <- split(xyOrd[["out"]], by = c("Polygons", "Polygon"),
flatten = FALSE, keep.by = FALSE)
bb <- lapply(seq(polyList), function(outerI) {
bb <- lapply(unique(xyOrd$out$Polygons), function(outerI) {
poly <- lapply(seq(polyList[[outerI]]), function(innerI) {
#Polygon(as.matrix(polyList[[outerI]][[innerI]][, c("x", "y")]),
Polygon(cbind(polyList[[outerI]][[innerI]]$x, polyList[[outerI]][[innerI]]$y),
Expand Down

0 comments on commit ef2b30f

Please sign in to comment.