【发布时间】:2022-11-04 16:15:18
【问题描述】:
我正在将多个相邻的多边形连接在一起,并使用smoothr 中的fill_holes 从现在的单个多边形中移除任何孔洞。但是,如果孔内有另一个多边形(或岛),则该多边形的轮廓仍然存在。有没有办法可以删除/溶解这些轮廓?
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")
【问题讨论】:
-
也许
sf::st_union?哦,我看到你有它......嗯。