[postgis-devel] ForceRHR doesn't?

Paul Ramsey pramsey at refractions.net
Sun Mar 12 09:21:35 PST 2006


Oops, I misread lwpoly for lwgeom (which made me wonder why your  
apparently recursive call to lwgeom_forceRHR did anything at all :)   
You're right, there it is.

And yes, isccw was returning a backwards result.  Fortunately the  
only thing using is was enforceRHR... which was apparently deeply  
unutilized :)

I have fixed this in CVS HEAD

P


On 11-Mar-06, at 11:12 PM, Michael Fuhr wrote:

> On Sat, Mar 11, 2006 at 09:58:10PM -0800, Paul Ramsey wrote:
>> It is not clear that there is a function that actually enforces RHR
>> in lwgeom... I know there is supposed to be one in GEOS, but I don't
>> see it getting called anywhere.
>
> lwpoly_forceRHR() in lwpoly.c looks like it's trying to return a
> RHR polygon, doesn't it?  That function isn't called from anywhere;
> that's what I made lwgeom_forceRHR() call in lieu of lwpoly_reverse().
>
> I'm still wondering if the ptarray_isccw() function that  
> lwpoly_forceRHR()
> calls has its return values backwards.
>
> Given a properly working ForceRHR(), you could enforce RHR on a
> column with a constraint like the following, no?
>
> ALTER TABLE foo ADD CONSTRAINT geom_rhr CHECK (geom ~= ForceRHR 
> (geom));
>
> Alternatively, you could write a trigger to silently convert the
> column to RHR during inserts and updates.
>
> -- 
> Michael Fuhr
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel




More information about the postgis-devel mailing list