FAILURE MAP
← Case archive

FA-70567 / GIS polygon topology / Member archive

Grid snapping with ring collapse handling: half rounding direction · case 02

Coordinates exactly half-way between grid lines snap inconsistently.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Input [rings, g]: polygon rings (exterior first), closed, numeric coordinates; grid size g > 0 anchored at 0. Each coordinate snaps to floor(v/g + 0.5)*g (halves round toward +infinity). Consecutive identical snapped positions are merged. A ring left with fewer than 4 positions has collapsed: if it is the exterior return None, otherwise drop that hole. Return the snapped rings.

Why this case matters

Precision reduction for storage, tiling and topology cleaning snaps vertices to a grid; collapse rules decide whether tiny holes vanish or the polygon is discarded.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression #12[[[1.0, 3.0], [8.0, 2.0], [8.0, 10.0], [1.0, 3.0]]][[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗