The function works by identifying US counties that intersect the input polygon layer,
then requesting water polygons (using tigris::area_water()
) to be erased from
those input polygons. The area_threshold
parameter can be tuned to determine the
percentile ranking of bodies of water (by area) to use;
the default is a percentile ranking of 0.75, erasing the largest 25 percent of water
bodies in the region.
Analysts will ideally have transformed the input coordinate reference system (CRS) of their data
to a projected CRS to improve performance; see https://walker-data.com/census-r/census-geographic-data-and-applications-in-r.html#coordinate-reference-systems for more information on
how to perform CRS transformations. Analysts should also use this function with caution;
the function may generate sliver polygons or irregular geometries in the output layer,
especially if the input sf object was not obtained with the tigris package. Also, the operation
may be quite slow for large input areas.