[postgis-users] is there a function which checks the Right-Hand-Rule (RHR)?

Sandro Santilli strk at keybit.net
Thu Feb 23 02:07:53 PST 2012


Astrid, I had the same need for topological functions too.
And I also did end up using ST_OrderingEquals/ST_ForceRHR.
Having an ST_IsRHR or an ST_IsCCW (for single rings) or an
ST_WindingFactor/ST_CrossProduct (for portions of a ring) would
help performance.
The last one would probably be the fastest for topological oriented code  
a ticket exists about it: http://trac.osgeo.org/postgis/ticket/1498

--strk;

On Thu, Feb 23, 2012 at 09:07:53AM -0000, Astrid Emde wrote:
> 
> On Thu, February 23, 2012 8:46 am, Astrid Emde wrote:
> > Hello,
> >
> >
> > I want to check whether my polygons follow the Right-Hand-Rule. Is there
> > a function to do this?
> >
> > I found the function ST_ForceRHR [1] that will modify my polygons to
> > follow the rule. But it would be nice to check first which polygons will be
> > effected.
> >
> > Astrid
> >
> >
> > [1] http://www.postgis.org/documentation/manual-1.5/ST_ForceRHR.html
> 
> Hello,
> 
> I used the following SQL to find out which polygons do not follow the RHR:
> 
> Select gid, st_orderingEquals(the_geom, st_forceRHR(the_geom))
> from mytable
> where st_orderingEquals(the_geom, st_forceRHR(the_geom)) = false;
> 
> Astrid
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-users mailing list