R Geometry Slivers – How to Remove Elongated, ‘Thin’ Parts of Shapes Using R

geometrypolygonrslivers

I have a dataset with a lot of polygons, of which some are long and thin in shape (see image). I'd like to remove their "extremities".

Is there a tool/method to remove thin parts of a polygon in R?*

In the example, the elongated shapes vary in shape and thickness

  • I thought about using a shape-ratio (e.g. perimeter/area, as described here), but that only allows me to remove complete polygons, whereas in some cases I'd like to preserve the "roundish" part of a polygon.
  • I'd like to be able to experiment with thresholds to find a suitable setting for the "roundness".
  • Removing thin rectangles from a shapely polygon seems like a similar problem, but I'd rather not use shapely

example of polygons with elongated shapes

Best Answer

Try using buffer

  1. Buffer with a negative distance, for example -50
  2. Buffer with +60
  3. Clip the buffers with your original polygons