snapRoundingNoder on polygons result in MultiLineString
When using the snapRoundingNoder on the attatched dataset with a precision scale of 10, I get a MultiLineString where the number of decimal places are all reduced to 1, but the number of coordinate pairs go from 2818 in the original polygon data to 5419 in the resulting MultiLineString. This makes the data larger in bytes and more complex to work with. Is this the expected behavior?
Also, why is the result a MultiLineString? I don't see an obvious way to convert this back to polygons as there is no info on what were polygon exteriors and what were holes/interiors.
Here's how to use the SnapRoundingNoder to produce a reduced-precision coverage. The input is
- Input has 149 polygons with 2818 vertices. Many of the input polygons are very small and/or narrow.
- Dissolve the input lines (result: 387 lines with 2316 vertices)
- Use the SnapRoundingNoder with tolerance 1 (result: 1465 lines with 3376 vertices)
- Polygonize the lines (result: 79 polygons with 1452 vertices)
To map this back to the original polygons use point-in-polygon tests (which also finds holes/gaps).
The result smallest polygon has area = 1. The input has 57 polygons of smaller area, which are probably all collapsed. Here's a closeup of an area where the snapped coverage contains fewer polygons, since a narrow polygon has collapsed: