[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] Are there script examples for determine where vertices run clockwise or anti-clo
From: Paul Ramsey <pramsey () cleverelephant ! ca>
Date: 2022-02-17 21:39:56
Message-ID: 68A87765-E7B2-493F-AA4E-78D4C2C03D8C () cleverelephant ! ca
[Download RAW message or body]
Without closure it is not possible to say what orientation a linestring has.
ST_IsPolygonCW(ST_MakePolygon(ST_AddPoint(linestring, ST_StartPoint(linestring))))
P
> On Feb 16, 2022, at 11:31 PM, Shaozhong SHI <shishaozhong@gmail.com> wrote:
>
> How about each line gets split into segments. . Each segment is constructed with \
> two points (current and next points. Then, calculate bearing/azimuth
> Then, determine whether it is clockwise or counter-clockwise.
>
> Can this be done?
>
> Regards,
>
> David
>
> On Wed, 16 Feb 2022 at 20:39, Marcin Mionskowski <mionskowskimarcin@gmail.com> \
> wrote: It doesn't make sense for lines.
> Imagine LINESTRING(1 0,1 1) - which "part of a square" is this i.e. where is "the \
> center of the square": (1) 0.5,0.5 or (2) 1.5,0.5? If (1) it's CCW, if (2) CW.
>
>
> śr., 16 lut 2022 o 21:29 Shaozhong SHI <shishaozhong@gmail.com> napisał(a):
> The problem now is that I can not find anything for lines.
>
> Anything like ST_IsPolygonCW|ST_IsPolygonCCW for lines for instance, something like \
> ST_IsLineCW|ST_IsLineCCW.
> Regards,
>
> David
>
> On Wed, 16 Feb 2022 at 19:43, Marcin Mionskowski <mionskowskimarcin@gmail.com> \
> wrote: Assuming simple polygons, composed from exterior ring only (i.e. no \
> multipolygons), I think that you are looking for a function \
> {ST_IsPolygonCW|ST_IsPolygonCCW}.
> Greetings,
> Marcin
>
> śr., 16 lut 2022 o 19:55 Imre Samu <pella.samu@gmail.com> napisał(a):
> > how vertices run? clockwise or anti-clockwise?
>
> maybe the:
> https://postgis.net/docs/ST_Angle.html "Computes the clockwise angle between two \
> vectors." or https://postgis.net/docs/ST_Azimuth.html
>
> regards,
> Imre
>
>
> Shaozhong SHI <shishaozhong@gmail.com> ezt írta (időpont: 2022. febr. 16., Sze, \
> 17:06): Can we use PostGIS to find out how vertices run? clockwise or \
> anti-clockwise?
> Regards,
>
> David
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic