ST_IsPolygonCCW for invalid inputs
    Paul Ramsey 
    pramsey at cleverelephant.ca
       
    Tue Oct 14 16:44:44 PDT 2025
    
    
  
Grrr, I'm trying to fix https://trac.osgeo.org/postgis/ticket/5754 which on
the surface is quite simple, but it actually exposes a bit of a rats nest
of bad logic.
I have a good fix that mostly works, but now I have a "big" regression: the
old function returned "true" when handed non-polygonal inputs.
https://github.com/postgis/postgis/blob/master/regress/core/orientation.sql#L3-L11
Also for empty polygon inputs.
My feeling is that a geometry is "clockwise" if it is (a) a polygon or
polygonal and (b) the outer ring is clockwise and (c) the inner rings are
anti-clockwise. Otherwise it's not oriented. (My changes for this work
mostly centered around the fact that a geometry can have one of three
orientations: clockwise, anticlockwise, and none. That made the logic, I
think, more straightforward to understand.)
So, this change is for 3.7 and I'd like to change the behaviour for
non-polygonal inputs to the ST_IsPolygonCCW and ST_IsPolygonCW functions.
P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20251014/c1e8b4da/attachment.htm>
    
    
More information about the postgis-devel
mailing list