You're probably looking for an ST_IsCCW() function ( is counter-clock-wise ? ).
Such a function could only work with closed and simple lines (see ST_IsClosed and ST_IsSimple). It's not available at the moment, but defining the interface is half work, so shouldn't cost too much to add :) --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html On Sun, May 02, 2010 at 11:27:25AM +0200, Andrea Peri wrote: > Hi, > > I do some test. > > I notice that the ST_OrderingEquals > > return true only when two lines are perfectly identical (same sequence > vertex too). > > For example: > > Select ST_OrderingEquals( > ST_GeomFromText('LINESTRING(2 3, 3 2, 6 1)',3003 > ),ST_GeomFromText('LINESTRING(2 3, 3 2, 6 1)',3003 ) > ) > > But if I add a single vertex to one of lines it return false. > Select ST_OrderingEquals( > ST_GeomFromText('LINESTRING(2 3, 3 2, 6 1, 8 9)',3003 > ),ST_GeomFromText('LINESTRING(2 3, 3 2, 6 1)',3003 ) > ) > > So it is not useful to detect the versus of lines because > the linestring of the line table is not sure they are perfectly identical to > the definition of the boundary of polygons. > The boundary of polygons are always closed lines. > Instead the same closed arc may be require more lines of the line table. > > More again: > even supposing the lines-table elements was closed like the boundary of > polygons the ST_OderingEqual require they are > first vertex identical. > > So this case of two lines identical, and same versus but different starting > vertex, return false. > > Select ST_OrderingEquals( > ST_GeomFromText('LINESTRING(2 3, 3 2, 6 1, 8 9, 2 3)',3003 > ),ST_GeomFromText('LINESTRING(3 2, 6 1, 8 9, 2 3, 3 2)',3003 ) > ) > > Regards, > > > -- > ----------------- > Andrea Peri > . . . . . . . . . > qwerty àèìòù > ----------------- > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
