Skip to content

Commit eb3cd7c

Browse files
authored
Merge pull request #375 from rstudio/joe/feature/multipolythings
Use existing comment if one exists
2 parents 24a7dfa + 38f546f commit eb3cd7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/normalize-sp.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ to_multipolygon.Polygons <- function(pgons) {
9292
# If Polygons contains more than one Polygon, then we may be dealing with
9393
# a polygon with holes or a multipolygon (potentially with holes). Use
9494
# createPolygonsComment to validate and determine what the situation is.
95-
comment <- rgeos::createPolygonsComment(pgons)
95+
comment <- comment(pgons)
96+
if (is.null(comment) || comment == "FALSE")
97+
comment <- rgeos::createPolygonsComment(pgons)
9698
pstatus <- as.integer(strsplit(comment, " ")[[1]])
9799
lapply(which(pstatus == 0L), function(index) {
98100
# Return a list of rings, exterior first

0 commit comments

Comments
 (0)