Opened 3 years ago

Closed 3 years ago

#5342 closed defect (fixed)

isClockwise() doesn't work correctly in some degenerated polygons

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.10.2
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

In the following degenerated polygon, (5 1) is the first(and last) point, and as well the pivot point selected by the algorithm (as being the lowest rightmost vertex), but is is also reused later in the coordinate list. But the second ring should be considered as counter-clock-wise

geom = ogr.CreateGeometryFromWkt?('POLYGON ((0 0,0 10,10 10,10 0,0 0),(5 1,4 3,4 2,5 1,6 2,6 3,5 1))')

Change History (3)

comment:1 Changed 3 years ago by Jukka Rahkonen

Nice butterfly. JTS complains that the inner ring has a ring self-intersection but draws it as a hole if it is told not to mind about the error. Is this the result you aim at?

comment:2 Changed 3 years ago by Even Rouault

I did'nt check with the Simple Feature spec if it was allowed or not. I found this (well a more complicated real-world case than the simplified example above) in a FileGDB dataset, and the intent was definitely to consider it as a hole. I've the fix and commit it as soon as my Internet connexion comes back to life.

comment:3 Changed 3 years ago by Even Rouault

Milestone: 1.10.2
Resolution: fixed
Status: newclosed

trunk r26789, branches/1.10 r26790 "OGRLinearRing::isClockwise(): make it work in a degenerated case when a vertex is used several times in the vertex list (#5342)"

Note: See TracTickets for help on using tickets.