Ticket #1274 (closed defect: fixed)

Opened 19 months ago

Last modified 18 months ago

ST_CreateTopoGeo failed

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: topology Version: trunk
Keywords: Cc:

Description

The attached SQL file imports a table of multipolygons which when collected and given in input to ST_CreateTopoGeo trigger an error about a mismatch between a node and a curve endpoint.

The cause of the bug is in issue #1273 (a point is not equal to the same point but with a bounding box added). I've filed this other bug because I belive another bug is hiding somewhere else in that nodes in the topology being constructed are being points with a bounding box cache attached, which isn't expected.

Also, I'll attach the input to this ticket.

Attachments

small_sample.sql.gz Download (2.3 KB) - added by strk 19 months ago.
smaller_sample.zip Download (0.8 KB) - added by strk 19 months ago.
smaller sample

Change History

Changed 19 months ago by strk

Changed 19 months ago by strk

The fix for #1273 wasn't enough to fix this. Next stop: GetNodeByPoint? returning 0 for a given point. Chances are is && or ST_Intersects or ST_DWithin failing.

Changed 19 months ago by strk

GetNodeByPoint? returning 0 means no point found, which means a point added with ST_AddIsoNode isn't found later. Probably still suffering from float vs. double but I'll need closer inspection

Changed 19 months ago by strk

Oddly enough, interrupting the insertion of edges on error and querying the database I find 2 candidate points but both seem to be pretty far from each-other:

=# with p as ( select '0101000000B0B7BE9F8369294180870580ACEA2841'::geometry g ) select node_id, st_distance(geom, p.g) from small_sample_topo.node, p where geom && p.g;
 node_id |     st_distance
---------+----------------------
    2515 | 3.97360129963356e-08
    2516 | 0.000998956812181611
(2 rows)

Now to figure out how did that point move... (hoping ST_Distance is _not_ using bounding box)

Changed 19 months ago by strk

smaller sample

Changed 19 months ago by strk

Second sub-product of this dataset is in #1284

This dataset is triggering multiple sub-problems. Numbers can be pretty tricky!

Changed 18 months ago by strk

Third sub-product of this dataset was #1302, squashed this morning. Let's see who's next.

Changed 18 months ago by strk

  • status changed from new to closed
  • resolution set to fixed

Alright, it looks like there's nothing else. As of r8212 the small_sample.sql.gz dataset can be converted to a topology on both 32bit and 64bit system.

Summary:

 Topology small_sample_topo (2042), SRID 0, precision 0
 83 nodes, 156 edges, 74 faces, 0 topogeoms in 0 layers

It's interesting to note how once constructed the topology can be more easily cleaned by inspecting suspicious areas:

Edges which partecipate in the boundary of a faces whose bounding box has an area < 0.1:

with smallfaces as ( select face_id from small_sample_topo.face where st_area(mbr) < 0.1 ) select edge_id from small_sample_topo.edge_data where left_face in (select * from smallfaces ) or right_face in (select * from smallfaces) order by edge_id;

Automating further cleanup could mean getting the longest edge in each "small_face" and removing it, so to assign the small face area to an adiacent face.

Note: See TracTickets for help on using tickets.