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

Astrid Emde astrid.emde at wheregroup.com
Thu Feb 23 01:07:53 PST 2012


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




More information about the postgis-users mailing list