Skip to content

Add grid test 769: inner ring touching outer at two points, splitting it into two components - #11

Open
brawer wants to merge 1 commit into
osmcode:masterfrom
brawer:add-grid-test-769-inner-touching-outer-two-points
Open

Add grid test 769: inner ring touching outer at two points, splitting it into two components#11
brawer wants to merge 1 commit into
osmcode:masterfrom
brawer:add-grid-test-769-inner-touching-outer-two-points

Conversation

@brawer

@brawer brawer commented Aug 12, 2026

Copy link
Copy Markdown

grid has 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/8 from 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 anything grid doesn't; as far as we could tell, this two-point-touch case was the only thing it covered that grid didn'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.wkt follow the existing 7xx ID/coordinate conventions from grid/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's BooleanOps-based even-odd containment resolution, not hand-derived.

data/all.osm, data/tests.json, and grid.db regenerated via make data and make grid.


This PR (including the test-case design and the analysis above) was generated by Claude Code, sent on behalf of @brawer.

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant