Opened 13 years ago

Closed 13 years ago

#1274 closed defect (fixed)

ST_CreateTopoGeo failed

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: topology Version: master
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 (2)

small_sample.sql.gz (2.3 KB ) - added by strk 13 years ago.
smaller_sample.zip (791 bytes ) - added by strk 13 years ago.
smaller sample

Download all attachments as: .zip

Change History (8)

by strk, 13 years ago

Attachment: small_sample.sql.gz added

comment:1 by strk, 13 years ago

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.

comment:2 by strk, 13 years ago

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

comment:3 by strk, 13 years ago

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)

by strk, 13 years ago

Attachment: smaller_sample.zip added

smaller sample

comment:4 by strk, 13 years ago

Second sub-product of this dataset is in #1284

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

comment:5 by strk, 13 years ago

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

comment:6 by strk, 13 years ago

Resolution: fixed
Status: newclosed

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.