Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3359 closed defect (fixed)

toTopoGeom misses a component linestring

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

Description

The attached script shows a bug in topology.toTopoGeom which fails to properly list 2 edges as components of a just-created TopoGeometry. It inserts a 3 vertices line first, creating an edge, and a 4 vertices line fully containing the first, creating a second edge. While TopoGeo_addLinestring properly returns both edges as being created, the relation table as populated by toTopoGeom contains a single edge for the newly added TopoGeometry record.

Attachments (1)

pgis_bug3359.sh (1018 bytes ) - added by strk 9 years ago.
script reproducing the bug

Download all attachments as: .zip

Change History (11)

by strk, 9 years ago

Attachment: pgis_bug3359.sh added

script reproducing the bug

comment:1 by strk, 9 years ago

Milestone: PostGIS 2.2.1PostGIS 2.1.9
Version: 2.2.x2.1.x

2.1.8 is also affected

comment:2 by strk, 9 years ago

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

2.0.7 is also affected

comment:3 by strk, 9 years ago

The debug log contains a clearly bogus assertion:

DEBUG: Elem {2,2} already in {2,1}

The assertion check comes from:

elems @> ARRAY[elem]

I'm afraid this is a tipical misuse of PostgreSQL particular arrays

comment:4 by strk, 9 years ago

NOTE: this is not easy to reproduce because it only fails when both numbers in the second TopoElement (in this case {2,2}) are present in the array of already added elements, so it needs be done with an empty topology (so that first edge gets id=1 and second edge id=2)

comment:5 by strk, 9 years ago

Another note: the same bug should happen with faces, wereas face {3,3} would fail to be added to the definition of a topogeometry (will try to craft a test for that too)

comment:6 by strk, 9 years ago

Resolution: fixed
Status: newclosed

(In [14368]) Fix toTopoGeom loss of low-id primitives from TopoGeometry definition

Affects toTopoGeom on including edge with id=2 and face with id=3 Includes tests. Fixes #3359

comment:7 by strk, 9 years ago

(In [14373]) Fix toTopoGeom loss of low-id primitives from TopoGeometry definition

Affects toTopoGeom on including edge with id=2 and face with id=3 Includes tests. Fixes #3359

comment:8 by strk, 9 years ago

(In [14374]) Fix toTopoGeom loss of low-id primitives from TopoGeometry definition

Affects toTopoGeom on including edge with id=2 and face with id=3 Includes tests. Fixes #3359

comment:9 by strk, 9 years ago

(In [14375]) Fix toTopoGeom loss of low-id primitives from TopoGeometry definition

Affects toTopoGeom on including edge with id=2 and face with id=3 Includes tests. Fixes #3359

comment:10 by strk, 9 years ago

  • 2.0 (2.0.8) fixed with r14368
  • 2.1 (2.1.9) fixed with r14373
  • 2.2 (2.2.1) fixed with r14374
  • trunk (2.3.0) fixed with r14375
Note: See TracTickets for help on using tickets.