Add grid test 769: inner ring touching outer at two points, splitting it into two components - #11
Conversation
An inner ring that touches the outer 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. grid has single-point (7/754-7/758) and shared-line (7/756, 7/757) inner/outer touches, and a single self-touching way resolving into two components (7/765, 7/766), but not this two-separate-rings, two-point-touch case. data/all.osm, data/tests.json, and grid.db regenerated via `make data` and `make grid`.
|
Do you have an actual use case for this? |
|
I'm working on a pipeline that (among other things) assembles the geometry of OSM features as OGC Simple Features; to make sure it works, I run unittests against osm-testdata. Somewhat accidentally, I came across https://github.com/nimix/osm_conv_tests which looks like another, second test corpus for the same problem. So I wondered if that contains any corner cases not yet covered by osm-testdata. Mostly not, with one exception, hence this pull request. |
|
Okay, so it's not about some actual current problem with Osmium-based software. I am afraid it goes on the low-priority pile then. Will take me a while to check this, because AI code needs extra careful review. |
|
Yeah, I know. I maintain a bunch of open-source projects myself, and it's really painful to review all these AI-generated changes. Not sure if there's a solution to this, though. Anyhow, feel free to ignore, I just tried to improve your test suite, since it's a really useful piece to have. For my own pipeline, I wrote a separate unit test for the corner case this PR (#11) is about, so this isn't blocking me at all in any way if you don't find the time to review it. — Also, thanks so much for everything you're doing for the OSM world! |
gridhas fixtures for an inner ring touching the outer at a single point (7/754-7/758) and touching along a shared line (7/756,7/757), and for a single self-touching way resolving into two components (7/765,7/766). It doesn't seem to have a case for two separate simple rings — one outer, one inner — where the inner ring touches the outer at exactly two points, so removing it splits the outer's boundary into two disjoint polygons rather than leaving one polygon with a hole. Test 769 (a free ID in the mp-geom bounding box (7.9 1.6, 8.0 1.7)) adds that case.This mirrors
geometry_multipolygon/8from nimix/osm_conv_tests, a 2012, unlicensed predecessor test suite for the same kind of OSM-to-GIS geometry conversion. We came across it while investigating a geometry bug of our own and wondered whether it had anythinggriddoesn't; as far as we could tell, this two-point-touch case was the only thing it covered thatgriddidn't already have. We asked about the relationship between the two repos in nimix/osm_conv_tests#2 — linking it here too since that's the same @joto who'll see this PR.Both member ways are untagged, matching the plain/no-frills style of nearby fixtures like 706.
data.osm/test.json/result/nodes.wkt/ways.wktfollow the existing 7xx ID/coordinate conventions fromgrid/README.md(nodes 769000-769007, ways 769800/769801, relation 769900; bounding box derived from the test number). The expected WKT was verified against georust/geo'sBooleanOps-based even-odd containment resolution, not hand-derived.data/all.osm,data/tests.json, andgrid.dbregenerated viamake dataandmake grid.This PR (including the test-case design and the analysis above) was generated by Claude Code, sent on behalf of @brawer.