Add test for an inner ring touching the outer at two points - #643
Merged
Conversation
Covers a PolygonAssembler case not exercised elsewhere: an inner ring that touches the outer ring at exactly two points (not along an overlapping edge, not crossing), so removing it splits the outer into two disjoint polygons rather than leaving one polygon with a hole. Found while checking whether the (2012, unlicensed, since-superseded) nimix/osm_conv_tests test suite had anything our vendored osm-testdata grid corpus doesn't. This was the one case it had that grid didn't (grid covers single-point and shared-line inner/outer touches, and a single self-touching way resolving into two components, but not this two-separate-rings, two-point-touch case) -- also proposed upstream as osmcode/osm-testdata#11. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
Adds
inner_touching_outer_at_two_points_splits_it_into_two_piecestoPolygonAssembler's tests: an inner ring that touches the outer ring at exactly two points (not along an overlapping edge, not crossing), so removing it splits the outer into two disjoint polygons rather than leaving one polygon with a hole.Why
While looking into #635, we checked whether the (2012, unlicensed, since-superseded) nimix/osm_conv_tests test suite had anything our vendored
osm-testdatagrid corpus doesn't. Everything distinctive in it turned out to already be covered — except this one case.gridhas fixtures for single-point inner/outer touches (7/754-7/758), touching along a shared line (7/756,7/757), and a single self-touching way resolving into two components (7/765,7/766) — but not two separate simple rings where the inner touches the outer at exactly two points.Also proposed upstream as osmcode/osm-testdata#11, so
griditself gains the coverage too — this test stands on its own regardless of whether that's accepted.Testing
Geometry::MultiPolygonwith 2 elements).geometry::tests pass, clippy and fmt clean.