topology.AddEdge: correctly handle the case in which a newly added closed edge touches an existing closed edge with an endpoint over a non-endpoint [RT-SIGTA].

git-svn-id: http://svn.osgeo.org/postgis/trunk@6649 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2011-01-17 08:47:34 +00:00
parent d5c2ca585b
commit c4ac0d5a9b
3 changed files with 7 additions and 4 deletions

View file

@ -261,11 +261,10 @@ BEGIN
-- they have puntual intersection between interiors
--
-- compute intersection, check it's a single point
-- and equals first StartPoint _and_ second StartPoint
-- and equals first's StartPoint _and_ second's StartPoint
IF ST_Equals(ST_Intersection(rec.geom, aline),
ST_StartPoint(aline)) OR
ST_Equals(ST_Intersection(rec.geom, aline),
ST_EndPoint(aline))
ST_StartPoint(aline)) AND
ST_Equals(ST_StartPoint(aline), ST_StartPoint(rec.geom))
THEN
RAISE DEBUG
'Closed edge shares boundary with existing closed edge %',

View file

@ -52,6 +52,9 @@ SELECT '#770-2', topology.addEdge('tt', 'LINESTRING(8 10, 9 8, 10 9, 8 10)');
SELECT '#770-*', topology.addEdge('tt', 'LINESTRING(8 10, 8 12, 10 12)');
-- same as above, but this time the new edge is closed too
SELECT '#770-*', topology.addEdge('tt', 'LINESTRING(8 10, 7 13, 10 12, 8 12, 10 12)');
-- once again, but the intersection is now at the new edge endpoint
-- (not the existing edge endpoint)
SELECT '#770-*', topology.addEdge('tt', 'LINESTRING(10 12, 11 12, 10 13, 10 12)');
SELECT edge_id, left_face, right_face,
next_left_edge, next_right_edge,

View file

@ -19,6 +19,7 @@ e6|6
#770-2|8
ERROR: Edge intersects (not on endpoints) with existing edge 7
ERROR: Edge intersects (not on endpoints) with existing edge 7
ERROR: Edge intersects (not on endpoints) with existing edge 7
1|0|0|1|1|LINESTRING(0 0,8 0)
2|0|0|2|2|LINESTRING(8 0,8 10)
3|0|0|3|3|LINESTRING(0 0,0 10)