Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#1968 closed defect (fixed)

toTopoGeom: missing edges on returned topogeometry

Reported by: amartin Owned by: strk
Priority: high Milestone: PostGIS 2.0.4
Component: topology Version: 2.0.x
Keywords: totopogeom edge history Cc:

Description

This query creates 8 edges in the topology but returns a topogeometry object with only 7 edges (i.e. the relation table has only 7 records for that topogeometry object).

SELECT totopogeom( st_geomFromtext('MULTILINESTRING ((535695.149659 4352913.865809, 535688.723014 4352898.92539, 535723.74701 4352895.150892, 535753.102703 4352892.178469, 535795.04699 4352887.189505, 535796.627126 4352887.671191, 535833.621825 4352884.315548, 535876.015985 4352880.471036), (535835.196958 4352883.587799, 535876.015985 4352880.471036), (535721.65 4352723.95, 535856.49208 4352710.87767), (535716.757204 4352776.376076, 535709.98 4352820.5, 535707.36 4352839.32, 535706.76 4352849.87, 535702.8 4352855.33, 535692.11 4352866.25, 535687.41 4352875.78, 535687.44 4352887.6, 535688.11 4352897.4, 535688.497742 4352897.353794), (535721.65 4352723.95, 535718.85 4352752.09, 535717.5 4352771.54, 535716.757204 4352776.376076), (535856.49208 4352710.87767, 535871.413761 4352859.350046, 535858.408056 4352862.146972, 535849.178201 4352866.7619, 535839.8085 4352874.733138, 535835.613111 4352880.746528, 535835.196958 4352883.587799), (535688.497742 4352897.353794, 535688.721074 4352898.927358, 535695.149659 4352913.865809))',25830),'the_topo', 2, E'0.8');                     

Change History (10)

comment:1 Changed 6 years ago by robe

Component: postgistopology
Owner: changed from pramsey to strk

comment:2 Changed 6 years ago by strk

I suspect the snapping due to the tolerance (0.8 in your case) is making an edge collapse. Try with a tolerance of 0.

comment:3 Changed 6 years ago by strk

Status: newassigned

After trying your call I actually see 7 lines in input and 7 edges in output. But you're right that 8 edges are created !

comment:4 Changed 6 years ago by strk

Priority: mediumhigh

Ok, confirmed. The missing edge is even pretty big

comment:5 Changed 6 years ago by amartin

Hi, glad you confirmed it. This defect might be related to ticket #1979

comment:6 Changed 6 years ago by strk

Milestone: PostGIS 2.0.2PostGIS 2.0.3

comment:7 Changed 5 years ago by strk

The missing edge is created by effect of a split of a previously added edge. For some reason the split is not seeing the newly added TopoGeometry object, thus is unable to add the split edge to its definition. Could have to do with function modifiers (stable vs. volatile?)

comment:8 Changed 5 years ago by strk

Only happens when it's a _node_ of one of the lines splitting an existing edge, not when it's an edge crossing another.

Simplified testcase:

SELECT CreateTopology('t');
CREATE TABLE t.fline(id serial);
SELECT AddTopoGeometryColumn('t','t','fline', 'g', 'line');
INSERT INTO t.fline(g) SELECT totopogeom( 'MULTILINESTRING ((0 0, 10 0),(5 0, 5 5))','t', 1);

comment:9 Changed 5 years ago by strk

Keywords: history added
Resolution: fixed
Status: assignedclosed

r11152 in trunk, r11153 in 2.0 branch

comment:10 Changed 5 years ago by strk

r11154 fixes the original case in 2.0 branch where the code was missing the re-check of duplicate edges. r11155 adds the same test for trunk (where the case is already fixed)

Note: See TracTickets for help on using tickets.