Open siromega opened 1 month ago
This kind of error can occur because mapshaper's functions for intersection detection are not extremely robust (floating point rounding errors can cause incorrect results).
These errors can also occur when the source data has certain kinds of errors (like incorrect polygon winding order in Shapefiles and incorrect ring/hole order in GeoJSON sources). To check for this kind of error, try running -clean rewind
before your original clean command.
If running -clean rewind
does not fix the error, I would appreciate it if you could send me a sample file, so I can replicate the error and possibly fix it.
Thanks!
I tried the clean -rewind, and it did not have an impact.
I reviewed the source data I downloaded to generate the larger combined file. I cleaned up the problem geometry and reprocessed the data, and when I ran the clean on the larger combined file, this time, it preserved the polygon and behaved in the expected way.
The detail I believe made this particular shape a problem was "spikes" from the exterior polygon ring. I cleaned these spikes up by removing the vertices out in space, and the polygon seemed to work better with the clean command.
My issue is solved.
If you are interested in the source polygon that had the spikes, I can give that to you whenever you'd like.
I am working with a set of data, and in the course of my processing, polygons are being diminished from a polygon to just slivers of the outline.
Starting polygon
Resulting polygon after "filter-slivers" and "clean allow-overlaps".
A regular polygon became just boundary slivers after these two processing steps.
Inspect before the processing: Type: polygon Rings: 1 cw, 2 ccw (which goes to 1 cw, 0 ccw after filter-slivers, and to 48 cw 0 ccw after clean allow-overlaps)
The spherical area is also dramatically reduced since it's just a bunch of boundary polygon slivers.
If I run filter-slivers again, it deletes the 48 cw rings, and I have no geometry anymore.
If you need any additional information, please let me know.