Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve MultiPolygon with holes #168

Merged
merged 3 commits into from
Aug 13, 2022
Merged

Conversation

mattijn
Copy link
Owner

@mattijn mattijn commented Aug 13, 2022

This PR fix #148 and #167.

I've changed the _resolve_bookkeeping() function. This function replace the geom ids with the corresponding arc ids. Before the corresponding arc ids were collected without considering the shape of the geom id. Now we take the arcs_in_geom as base and set the arc_ids for the corresponding arc in the same object.

This gives the right nesting for MultiPolygons and MultiPoint, but for other feature types the arcs become nested one level too deep. By updating the _resolve_arcs() function to unnest nested arcs for the other features, I could make all the tests pass. Except one (test_hashmap_geomcol_multipolygon_polygon).
Before the approach was done reversly. All single features were fine, but the multi features were nested one level deeper.

Upon inspection of the failed test, I realized that this covers the issue as is described in both linked issues, but was asserted wrongly..

Now for this test the input MultiPolygon is also a MultiPolygon in the output.

@mattijn mattijn merged commit ba5d33c into master Aug 13, 2022
@mattijn mattijn deleted the resolve-multipolygon-with-holes branch August 13, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conversion to Typology object causes overlaps
1 participant