RETURN newedge.edge_id;
END IF;
- RAISE WARNING 'ST_AddEdgeNewFaces: edge % splitted face %',
+ RAISE NOTICE 'ST_AddEdgeNewFaces: edge % splitted face %',
newedge.edge_id, newedge.left_face;
- IF newedge.left_face != 0 THEN
+ IF newedge.left_face != 0 THEN -- {
-- Set old face edges to zero to let AddFace do something with them
EXECUTE 'UPDATE ' || quote_ident(atopology)
FOR rec IN SELECT geom FROM ST_Dump(fan.post)
ORDER BY ST_XMin(geom), ST_YMin(geom)
LOOP -- {
+ -- skip the polygons whose boundary does not contain
+ -- the newly added edge
+ IF NOT ST_Contains(ST_Boundary(rec.geom), acurve) THEN
+ CONTINUE;
+ END IF;
+
RAISE DEBUG 'Adding face %', ST_AsText(rec.geom);
sql :=
'SELECT topology.AddFace(' || quote_literal(atopology)
|| '.face WHERE face_id = ' || newedge.left_face;
EXECUTE sql;
- ELSE
+ ELSE -- }{
FOR rec IN SELECT (ST_Dump(fan.post)).geom
LOOP -- {
RAISE DEBUG 'Added faces: %', newfaces;
- END IF;
+ END IF; -- }
RETURN newedge.edge_id;
END
UNION VALUES (36),(16) )
ORDER BY edge_id;
+--
+-- Split a face containing an hole
+--
+INSERT INTO newedge SELECT 22, topology.st_addedgenewfaces('city_data',
+ 3, 3, 'LINESTRING(25 35, 27 35, 26 34, 25 35)');
+SELECT 'T22', 'E'||edge_id, next_left_edge, next_right_edge,
+ left_face, right_face FROM
+ city_data.edge WHERE edge_id IN (
+ SELECT edge_id FROM newedge WHERE id IN (22, 16)
+ UNION VALUES (2),(3) )
+ ORDER BY edge_id;
+
---------------------------------------------------------------------
-- Check new relations and faces status
T21|E36|-13|-36|0|27
T21|E46|-14|47|35|36
T21|E47|-46|36|36|0
+T22|E2|3|39|37|0
+T22|E3|48|2|37|37
+T22|E42|42|-42|37|32
+T22|E48|-3|-48|37|38
F3,F4|{3:10,3:11,3:23,3:24,3:25}
F5,N4|{1:4,3:12,3:13}
F0|
F28|POLYGON((3 11,3 17,9 17,9 11,3 11))
F29|POLYGON((5 27,5 30,11 30,11 27,5 27))
F30|POLYGON((22 27,22 30,28 30,28 27,22 27))
-F31|POLYGON((17 30,17 40,31 40,31 30,17 30))
F32|POLYGON((20 34,20 37,23 37,23 34,20 34))
F33|POLYGON((35 25,35 45,63 45,63 25,35 25))
F34|POLYGON((9 0,9 6,21 6,21 0,9 0))
F35|POLYGON((35 0,35 6,47 6,47 0,35 0))
F36|POLYGON((35 -4,35 6,47 6,47 -4,35 -4))
+F37|POLYGON((17 30,17 40,31 40,31 30,17 30))
+F38|POLYGON((25 34,25 35,27 35,27 34,25 34))
Topology 'city_data' dropped