I am joining multiple adjoining polygons together and removing any holes from the now single polygon using fill_holes
in smoothr
. However, if a hole has another polygon (or island) within it, the outline of that polygon remains. Is there a way these outlines can be removed/dissolved?
library(sf)
library(smoothr)
download.file("https://drive.google.com/uc?export=download&id=1-KcZce0jgIV0fwG797mq7FB5WjxwtKqX" , destfile="Zones.zip")
unzip("Zones.zip")
Zones <- st_read("Zones.gpkg")
Threshold <- units::set_units(1000, km^2)
Zones_No_Holes <- fill_holes(Zones %>% st_union, threshold = Threshold)
plot(Zones_No_Holes, col="aliceblue")