Skip to content

WIP: Add test for GEOS reported Orientation#isCCW robustness issue#1189

Open
strk wants to merge 3 commits intolocationtech:masterfrom
strk:geos-gh-1425
Open

WIP: Add test for GEOS reported Orientation#isCCW robustness issue#1189
strk wants to merge 3 commits intolocationtech:masterfrom
strk:geos-gh-1425

Conversation

@strk
Copy link
Copy Markdown

@strk strk commented Apr 13, 2026

@strk
Copy link
Copy Markdown
Author

strk commented Apr 13, 2026

For the record, tested locally the test fails:

OrientationIsCCWTest.testGeosTicketGH1425:113->checkCCW:118 Coordinate array isCCW: expected:false but was:true

@strk
Copy link
Copy Markdown
Author

strk commented Apr 13, 2026

@dr-jts by reading the code I was under the impression that similar case should be correctly handled but the Orientation#isCCW method, am I wrong ?

@strk
Copy link
Copy Markdown
Author

strk commented Apr 13, 2026

The case at hand is this (in HEXWKB form):

0103000000010000000A000000890205230D6C31408177583619475140FD613B270D6C314031AA5436194751405D58985776943140195EE965DE47514085FFA6647B9F31408FC1C62B394851405D58985776943140195EE965DE475140FD613B270D6C314031AA543619475140A4613B270D6C31402FAA543619475140890205230D6C31408177583619475140320205230D6C31407E77583619475140890205230D6C31408177583619475140

@strk
Copy link
Copy Markdown
Author

strk commented Apr 16, 2026

Simpler case:

POLYGON ((0 0,0 2, 2 1, 2 0, 0 2, 0 0))

that is, the next figure going clockwise starting from the bottom-left vertex is reported to be counterclockwise instead

image

@dr-jts
Copy link
Copy Markdown
Contributor

dr-jts commented Apr 16, 2026

Both of these polygons compute as invalid. The CCW algorithm isn't certified to work correctly on invalid geometry.

(The invalidity of the second polygon is obvious; the first one is hard to see).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants