Repository navigation
Conversation
force_2d() rebuilt 3D polygons from their exterior ring only, so a polygon or multipolygon with holes came back filled in. Carry the interior rings over when dropping the z coordinate.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1304 +/- ##
=======================================
Coverage 91.43% 91.43%
=======================================
Files 53 53
Lines 8395 8397 +2
=======================================
+ Hits 7676 7678 +2
Misses 719 719
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1234.
force_2d()rebuilt each 3DPolygon(and each part of aMultiPolygon) from its exterior ring only, so any holes were lost and the geometry came back filled in. It now carries the interior rings over when it drops the z coordinate.I added
test_force2d_preserves_holesintests/models/test_models.pyand a line to the changelog.Before / after (reproducer from the issue, a 10x10 square with a 2x2 hole, as a polygon and as a multipolygon):
Checks
pytest tests/models -k force2d: the new test fails onmainand passes with the fixpytest tests/models: 431 passed, 1 xfailedruff check/ruff format --checkpass on the changed filesmypyreports the same result as onmain