Opened 9 years ago

Closed 9 years ago

#3351 closed defect (fixed)

lwt_RemIsoEdge() bug - Nodes not restored so to be Isolated

Reported by: esseffe Owned by: strk
Priority: high Milestone: PostGIS 2.0.8
Component: liblwgeom Version: 2.0.x
Keywords: Cc:

Description

lwt_RemIsoEdge() does not correctly restore Nodes to an "Isolated" state after removing the Edge and this causes subsequent calls to lwt_RemIsoNode() to unexpectedly fail raising a "non-isolated node" exception. The following SQL snippet reproduces the issue:

BEGIN;
SELECT CreateTopology('topo', 4326, 0);
SELECT ST_AddIsoNode('topo', NULL, ST_SetSRID(ST_MakePoint(1, 1), 4326));
SELECT ST_AddIsoNode('topo', NULL, ST_SetSRID(ST_MakePoint(2, 2), 4326));
SELECT ST_AddIsoEdge('topo', 1, 2, ST_GeomFromText('LINESTRING(1 1, 2 2)',4326));
SELECT ST_RemoveIsoEdge('topo', 1);
SELECT ST_RemoveIsoNode('topo', 1);
ROLLBACK;

Change History (8)

comment:1 by strk, 9 years ago

Milestone: PostGIS 2.3.0PostGIS 2.1.9
Version: trunk2.1.x

I've tested this with 2.1 and it also does not update nodes on RemoveIsoEdge, so that part is not a regression (but still a bug). I guess it also happens in 2.0.

What's different in 2.1 is that it does let you remove the node, which is due to RemoveIsoNode in 2.1 checking for isolation by querying the edge table rather than by looking at the "containing_face" field.

So this would be a regression in RemoveIsoNode and a long-standing bug in RemoveIsoEdge.

comment:2 by strk, 9 years ago

esseffe do you confirm that removing the isolated edge with ST_RemEdgeModFace makes the test succeed ? (there's really no reason to use ST_RemIsoEdge…)

comment:3 by strk, 9 years ago

Milestone: PostGIS 2.1.9PostGIS 2.0.8
Version: 2.1.x2.0.x

comment:4 by strk, 9 years ago

(In [14335]) Set edge endpoints as isolated on ST_RemoveIsoEdge

See #3351

comment:5 by strk, 9 years ago

(In [14336]) Set edge endpoints as isolated on ST_RemoveIsoEdge

See #3351

comment:6 by strk, 9 years ago

(In [14337]) Set endpoints isolation in lwt_RemIsoEdge (ST_RemoveIsoEdge)

See #3351

comment:7 by strk, 9 years ago

(In [14338]) Set endpoints isolation in lwt_RemIsoEdge (ST_RemoveIsoEdge)

See #3351

comment:8 by strk, 9 years ago

Resolution: fixed
Status: newclosed

r14335 in 2.0 (2.0.8), r14336 in 2.1 (2.1.9), r14337 in 2.2 (2.2.1) and r14338 in trunk (2.3.0)

Note: See TracTickets for help on using tickets.