[postgis-devel] ForceRHR doesn't?

Paul Ramsey pramsey at refractions.net
Sun Mar 12 10:46:22 PST 2006


Would not hurt, the functionality being there and all... I am  
thinking of replacing ForceRHR with ForceCCW and ForceCW, given our  
discussion about the meaning of RHR.  (ForceRHR would still remain,  
but be undocumented as a means of deprecation.)

P.

On 12-Mar-06, at 10:19 AM, Michael Fuhr wrote:

> On Sun, Mar 12, 2006 at 09:21:35AM -0800, Paul Ramsey wrote:
>> I have fixed this in CVS HEAD
>
> Thanks!  It looks like it's working now.
>
> SELECT AsText(geom) AS geom, AsText(ForceRHR(geom)) AS geomrhr FROM  
> foo;
>                      geom                      |                     
> geomrhr
> ----------------------------------------------- 
> +-----------------------------------------------
>  POLYGON((0 0,5 5,10 0,0 0),(2 1,8 1,5 4,2 1)) | POLYGON((0 0,5  
> 5,10 0,0 0),(2 1,8 1,5 4,2 1))
>  POLYGON((0 0,5 5,10 0,0 0),(2 1,5 4,8 1,2 1)) | POLYGON((0 0,5  
> 5,10 0,0 0),(2 1,8 1,5 4,2 1))
>  POLYGON((0 0,10 0,5 5,0 0),(2 1,8 1,5 4,2 1)) | POLYGON((0 0,5  
> 5,10 0,0 0),(2 1,8 1,5 4,2 1))
>  POLYGON((0 0,10 0,5 5,0 0),(2 1,5 4,8 1,2 1)) | POLYGON((0 0,5  
> 5,10 0,0 0),(2 1,8 1,5 4,2 1))
> (4 rows)
>
>> On 11-Mar-06, at 11:12 PM, Michael Fuhr wrote:
>>> 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));
>
> Would it make sense to have a function like IsRHR()?  That might
> make tests like the above a little more intuitive.
>
> Thanks again.
>
> -- 
> 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