I have a large global shapefile with thousands of small gaps/sliver polygons between joined polygons (shared borders of countries). I joined the shapefiles using the sf R package, and have attempted to resolve the issue using R as well as QGIS. The closest I've gotten is the workflow below:
- Create a polygon overlay, take difference, mutlipart to singlepart tool, union tool, create area column with calculated field, eliminate selected polygons tool (selecting the gaps by area in the attribute table). While this approach fixes most of the gaps, many dangling lines are left behind which creates an incompatible GeometryCollection type issue so I can't use any other tools to clean it up (like v.clean rmdangle or fix geometries) without errors or several of the polygons being removed. (I'd like to be able to use this file, since it does the trick for the most part but am unsure how to resolve the GeometryCollection collection error, similar post here)
- I also tried to find a way to use a country line file with a common id field to snap to the nearest border, but couldn't figure out an approach for that. Any advice for this approach welcomed as well!
- Currently experimenting with the rmapshaper package to use the snapping function within ms_simplify
I have read a ton of posts about resolving gaps between polygons in a shapefile to no avail although it seems to be a fairly common issue. I saw that the integrate tool in ArcGIS may be an option, but I'm suprised there's not an existing workaround with an open-source tool. Has anyone successfully found a way to resolve their gaps without ArcGIS?