[postgis-devel] ForceRHR doesn't?

Paul Ramsey pramsey at refractions.net
Sat Mar 11 21:49:04 PST 2006


Michael,

"Right hand rule" means "if I walk along the boundary of the polygon  
with my right hand extended, it is always inside the polygon".  So  
the external rings go clockwise, and the internal rings go anti- 
clockwise.

And it looks like you found a silly bug, since ForceRHR should not be  
calling an unconditional reverse.

Paul

On Mar 11, 2006, at 8:52 PM, Michael Fuhr wrote:

> On Sat, Mar 11, 2006 at 08:50:16PM -0700, Michael Fuhr wrote:
>> I've attached a patch that makes ForceRHR() work the way I was
>> expecting: return the points of the exterior and interior rings in
>> counter-clockwise order.  If I've misunderstood what ForceRHR() is
>> supposed to do then somebody please correct me.  Thanks.
>
> After a bit more reading it appears that I have indeed misunderstood
> how ForceRHR() should work with interior rings.  They're supposed
> to be ordered in the opposite direction as the exterior ring,
> correct?  The right-hand rule applied to polygons means the exterior
> ring is counter-clockwise and the interior rings are clockwise --
> is that right?  Or am I still confused?
>
> -- 
> 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