Open mdsumner opened 7 years ago
In sp we could do it by re-building every ring with Polygon():
library("rworldmap") map_coarse <- getMap(resolution = "coarse") ## recomposing with Polygon() will fix any that need it map_partly_fixed <- SpatialPolygonsDataFrame(SpatialPolygons(lapply(geometry(map_coarse)@polygons, function(a) Polygons(lapply(a@Polygons, function(b) Polygon(b@coords)), a@ID)), proj4string = CRS(proj4string(map_coarse))), map_coarse@data, match.ID = FALSE) rgeos::gIsValid(map_partly_fixed)
That is then still overlapping itself, see here: https://github.com/mtennekes/tmap/issues/96
In sp we could do it by re-building every ring with Polygon():
That is then still overlapping itself, see here: https://github.com/mtennekes/tmap/issues/96