Fill polygon holes that fall below a given area threshold.
spatial features; lines or polygons from either the
an area threshold, below which holes will be removed.
Provided either as a
A spatial feature, with holes filled, in the same format as the input data.
# fill holes smaller than 1000km2 p <- jagged_polygons$geometry area_thresh <- units::set_units(1000, km^2) p_dropped <- fill_holes(p, threshold = area_thresh) # plot par(mar = c(0, 0, 1, 0), mfrow = c(1, 2)) plot(p, col = "black", main = "Original") plot(p_dropped, col = "black", main = "After fill_holes()")