[postgis-tickets] [PostGIS] #4881: Lineal TopoGeometry objects do not conserve their direction

PostGIS trac at osgeo.org
Thu Mar 11 08:51:32 PST 2021


#4881: Lineal TopoGeometry objects do not conserve their direction
----------------------+---------------------------
 Reporter:  strk      |      Owner:  strk
     Type:  defect    |     Status:  new
 Priority:  medium    |  Milestone:  PostGIS 3.1.2
Component:  topology  |    Version:  1.5.X
 Keywords:            |
----------------------+---------------------------
 Simple testcase:
 {{{
 SELECT CreateTopology('t');
 CREATE TABLE t.f(i serial primary key);
 SELECT AddTopoGeometryColumn('t','t','f','g','LINE');
 SELECT ST_AsText(toTopoGeom('LINESTRING(0 0, 10 0)', 't', 1,
 0)::geometry);
 select ST_AsText(toTopoGeom(ST_Reverse('LINESTRING(0 0, 10 0)'), 't', 1,
 0)::geometry);
 }}}

 The last two queries are creating a TopoGeometry with two LINESTRING
 objects in opposite direction. When casting these two objects back to a
 GEOMETRY object the _same_ LINESTRING comes back, regardless of the
 original direction.

 I verified this is NOT a problem with toTopoGeom but with the cast to
 geometry, because changing the sign of the element_id in the relation
 table does NOT change the output of the ::geometry cast.

 This limitation is probably as old as the Topology support in PostGIS.
  MULTILINESTRING((0 0,10 0))

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4881>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list