[postgis-devel] ForceRHR doesn't?

Michael Fuhr mike at fuhr.org
Sun Mar 12 10:19:11 PST 2006


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



More information about the postgis-devel mailing list