[postgis-users] Establish versus of a line
Andrea Peri
aperi2007 at gmail.com
Fri Apr 30 03:13:00 PDT 2010
Hi Nicolas,
many thx for the hints (now I'm study better the ST_ForceRHR
function), but I think
my need is a bit more complex (Unfortunately).
Because I don't need to know if the polygon is clockwise or counter-clockwise.
I can surely assume all polygons are clockwise (for example).
But I need to know if the linestrings are same versus of the polygon
boundary or are reverse versus of the polygon boundary.
Regards,
Andrea.
>Hi Andrea,
>If I understand correctly, you want your linestrings to carry an
>attribute telling if the polygons they come from is clockwise or
>counter clockwise ?
>
>You could compare the original polygons and the reversed version, to
>determine their orientation:
>
>select st_orderingEquals(geom, st_forceRHR(geom)) from
>
>(select geometryFromText('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))', -1) as geom
>union
>select geometryFromText('POLYGON ((2 2, 2 3, 3 3, 3 2, 2 2))', -1) as
>geom) as foo
>;
>
>If you keep a link between linestrings and polygons they come from, an
>update to the linestrings table should be easy, then.
>HTH
>Nicolas
--
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100430/9253bc90/attachment.html>
More information about the postgis-users
mailing list