fill_holes | R Documentation |
Fill polygon holes that fall below a given area threshold.
fill_holes(x, threshold)
x |
spatial features; lines or polygons from either the |
threshold |
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[5]
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()")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.