Opened 4 years ago

Closed 4 years ago

#4884 closed defect (fixed)

toTopoGeom does NOT correctly set sign of element_id for linear TopoGeometry objects

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.2.0
Component: topology Version: 1.5.X
Keywords: Cc:

Description

With POSTGIS="3.2.0dev 3.1.0rc1-113-gd758f5025":

strk=# select createtopology('t2');
 createtopology 
----------------
              5
(1 row)

strk=# create table t2.l(id int);
CREATE TABLE
strk=# select addtopogeometrycolumn('t2','t2','l','g','line');
 addtopogeometrycolumn 
-----------------------
                     1
(1 row)

strk=# insert into t2.l(g) select toTopoGeom('LINESTRING(0 0, 10 0)'::geometry, 't2', 1, 0);
INSERT 0 1
strk=# insert into t2.l(g) select toTopoGeom('LINESTRING(10 0, 0 0)'::geometry, 't2', 1, 0);
INSERT 0 1
strk=# select * from t2.relation;
 topogeo_id | layer_id | element_id | element_type 
------------+----------+------------+--------------
          1 |        1 |          1 |            2
          2 |        1 |          1 |            2
(2 rows)

See also #4881 for how sign of element_id is not considered in output either

This bug/limitation is probably as old as PostGIS Topology.

Change History (2)

comment:1 by strk, 4 years ago

Milestone: PostGIS 3.1.2PostGIS 3.2.0

comment:2 by Sandro Santilli <strk@…>, 4 years ago

Resolution: fixed
Status: newclosed

In fb9fa7e/git:

Have TopoGeo_addLinestring return signed edge ids for lineals

Closes #4884 in main branch (3.2.0dev)

Update expected results accordingly
Add specific tests for totopogeom.

Note: See TracTickets for help on using tickets.