FA-70705 / GIS polygon topology / Member archive
WKT polygon and multipolygon ring structure: ordinate truncation · case 05
Rings from 3D sources carry elevations and fail closure when only z differs.
Case contract
Input: a WKT string. The keyword (case-insensitive) must be POLYGON or MULTIPOLYGON, else None; "<keyword> EMPTY" returns []. Otherwise parse the parenthesised body into polygons -> rings -> positions, keeping only x and y of every position (Z/M ordinates are dropped). Every ring must have at least 4 positions and be closed in x/y, else None. Return a list of polygons (a POLYGON gives a one-element list).
Why this case matters
WKT is the lingua franca between databases and GIS tools; losing a dimension or nesting level corrupts rings.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression #3 | [[[[0.0, 0.0, 5.0, 1.0], [4.0, 0.0, 5.0, 2.0], [4.0, 4.0, 6.0, 3.0], [0.0, 0.0, 5.0, 1.0]]]] | [[[[0.0, 0.0], [4.0, 0.0], [4.0, 4.0], [0.0, 0.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 ↗