Spikes/Slivers inside Polygons Not Cleaned Perfectly
I am trying to clean some polygons that have, what I would call, spikes or slivers within the outer boundary.
Closer look
-clean does a good job at handling most of these but this example seems to be a bit more stubborn, I haven't been able to clean it successfully. Any help would be appreciated.
Polygon is attached
Thanks for this, I'll investigate.
I think I see what's happening. A spike along the boundary of a polygon can have one of two forms: an overlap or a cut-in shape. If you zoom in to your example area, you can see that the spike that wasn't removed forms a cut:
The -clean command does not remove cuts, only overlaps. (The common definition of a clean or valid polygon requires that boundaries do not self-intersect, so overlaps are not allowed but cuts are allowed).
I can convert the cut into an overlap using the "draw/edit polygons" option:
... if you run -clean again, then the overlap is removed:
... this isn't a practical solution to your problem, however...
I'd like to add the ability to remove sliver-shaped cuts, but that will require a bit of R&D work.
Thank you for your investigation @mbloch !
For a little more context, my main issue is that when I try to insert this feature into my mongo database I get the folowing error.
] Edges 1420 and 1422 cross. Edge locations in degrees: [51.3480136, 3.8869813]-[51.3478703, 3.8861762] and [51.3479016, 3.8863525]-[51.3479427, 3.8863429]
Here are the supposed edges that cross. Might there be some function already available that would fix these edges?
So it might not even be the sliver necessarily I think, just some way the coordinates are ordered perhaps.