Morphological opening for vector polygon geometry (eliminate holes)

st_morph_open(x, radius = 0.01)

Arguments

x

object of class sf, sfc or sfg

radius

numeric or object of class units; radius for the morphological opening operation (dilation followed by erosion). In case x has geodetic coordinates (lon/lat) and sf_use_s2() is TRUE, a numeric radius is taken as distance in meters and a units object in radius is converted to meters. In case x has geodetic coordinates (lon/lat) and sf_use_s2() is FALSE, a numeric radius is taken as degrees, and a units object in radius is converted to arc_degree (and warnings are issued). In case x does not have geodetic coordinates (projected) then numeric radius is assumed to have the units of the coordinates, and a units radius is converted to those if st_crs(x) is not NA.

Value

object of class sf, sfc or sfg