[postgis-devel] ForceRHR doesn't?

Michael Fuhr mike at fuhr.org
Sat Mar 11 01:29:15 PST 2006


ForceRHR does a reverse instead of forcing a particular point order.
Am I misunderstanding something or is that broken?

SELECT AsText(ForceRHR('POLYGON((0 0,10 0,5 5,0 0))'));
           astext            
-----------------------------
 POLYGON((0 0,5 5,10 0,0 0))
(1 row)

SELECT AsText(ForceRHR(ForceRHR('POLYGON((0 0,10 0,5 5,0 0))')));
           astext            
-----------------------------
 POLYGON((0 0,10 0,5 5,0 0))
(1 row)

In lwgeom_forceRHR() in lwgeom.c is the following:

    case POLYGONTYPE:
        lwpoly_reverse((LWPOLY *)lwgeom);
        return;

Shouldn't that code call lwpoly_forceRHR?  That function exists but
isn't called from anywhere.

-- 
Michael Fuhr



More information about the postgis-devel mailing list