fix: CIRCULARSTRING(A,B,C,A) is a valid geometry (annulus) - #120
Merged
grootstebozewolf merged 2 commits intoAug 23, 2026
Conversation
ISO/IEC 13249-3 wants an odd control count. Closed four-control CIRCULARSTRING(A,B,C,A) is the #86 full-circle exception: complementary close is implicit, no leftover mid. Open even leftover still fails parse and isValid. A concentric pair of those rings is a valid annulus. topic: curve claimId: V-CS witness: circularstring-abca macro: V-CS lane: validity chunk: closed-4 issue: #86 Co-authored-by: jbloemscheer <jbloemscheer@gmail.com>
grootstebozewolf
marked this pull request as ready for review
August 23, 2026 05:03
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.
Fixes V-CS leftover after #86/#87.
topic: curve
claimId: V-CS
witness: circularstring-abca
macro: V-CS
lane: validity
chunk: closed-4
issue: #86
Catalogued slice
TRIAGE / EPIC Phase 2 V-CS (
CircularStringvalidity / simplicity).#87 already made the 3-click shell
CIRCULARSTRING(A,B,C,A)a fullcircumcircle (draw / length / disc kit). This pin is isValid / parse
acceptance of that 4-control form, plus the concentric pair as a
valid annulus. ISO/IEC 13249-3. No DOI.
Not #114 / tb-h-1 paint (PRs #118 / #119, HOLD UX SIGN). Not complementary
sweep-mid for major-arc holes. Not H-CC area
50 + 12.5 acos(0.6).Not 67-c / S15l / Touches-vs-Share. Not NTS. Not GEOS.
Observed
ISO/SFA wants an odd CircularString control count (3, 5, …).
CIRCULARSTRING(A,B,C,A)is 4 points: first arc A–B–C, then C–A has nostored mid.
WKTCircularStringTest.testRejectsEvenPointCounttreatedevery 4-point string as parse-invalid. After #87 the closed 4-control
form is a first-class full circle;
GeometryCombineralready acceptedit, but
CircularString.isValid()andCurveWKTReaderdid not.Expected
CIRCULARSTRING(-5 0, 0 5, 5 0, -5 0)parses, stays CircularString,4 controls, first=last,
isValid() == true.CIRCULARSTRING(0 0, 1 1, 2 0, 3 1)still fails parseand
isValid().CURVEPOLYGON (CIRCULARSTRING(-5 0, 0 5, 5 0, -5 0), CIRCULARSTRING(-3 0, 0 3, 3 0, -3 0))is a valid annulus (shell + hole, both 4-control). WKT is not rewritten;
no invented 5th control.
Change
CircularString.isValidControlCount/isValid: empty or odd ≥ 3, orclosed 4-control with a circumcircle (
threePointCircleCloseMid).CurveWKTReader.readCircularStringTextuses the same predicate(constructor still allows an invalid object; parse rejects open even).
CircularStringValidTest,WKTCircularStringTestaccept closed-4.Tests (local)
Checks
Checks: 4/4 green @ fce5d93
Merged to
feature/sfa-curve-rgrby grootstebozewolf at 2026-08-23T05:26:22Z (1e446de7). Merge-in only; V-CS blobs unchanged from2b56b1a4. NTS #19 / Proofs locationtech#532 do not need a SHA remint.