R/polygons_mutually_exclude.R
polygons_mutually_exclude.RdHelper function to ensure that polygons (e.g. parks, beaches, informal nature areas) are mutually-exclusive (i.e. non-overlapping).
polygons_mutually_exclude(input, mutually_exclude, snap_tolerance = 0)sf object to process (with projected coordinate reference system).
sf object. input polygons contained
within this object, and intersections between the two, will be removed.
Should have the same coordinate reference system as input.
numeric. Argument for tolerance level passed to sf::st_snap(),
used to rectify nearly coincident edges between polygons before running sf::st_contains().
Provided either as a units object (see units::set_units()),
or a number in the units of the coordinate reference system. Defaults to 0.
The processed input polygons (sf object).
Polygons vertices first are snapped at a tolerance level
based on snap_tolerance (if specified) to rectify nearly coincident edges,
before removing input polygons contained in mutually_exclude.
Intersections between the two are then removed.