]> granicus.if.org Git - postgis/commitdiff
New test for closing multi-edge ring in a face (ST_AddEdge*Face*)
authorSandro Santilli <strk@keybit.net>
Sat, 28 Jan 2012 10:42:50 +0000 (10:42 +0000)
committerSandro Santilli <strk@keybit.net>
Sat, 28 Jan 2012 10:42:50 +0000 (10:42 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8955 b70326c6-7e19-0410-871a-916f4a2858ee

topology/test/regress/st_addedgemodface.sql
topology/test/regress/st_addedgemodface_expected
topology/test/regress/st_addedgenewfaces.sql
topology/test/regress/st_addedgenewfaces_expected

index 728b06b56c03b5e3e86e31eb3425e3bbd2e85671..88d8c19c764227031c515f01912039e894459022 100644 (file)
@@ -415,6 +415,18 @@ SELECT 'T25', 'N' || node_id, containing_face FROM
   city_data.node WHERE node_id IN ( 27, 31, 32, 33, 34 )
   ORDER BY node_id;
 
+--
+-- Split a face closing a ring inside a face
+--
+INSERT INTO newedge SELECT 26, topology.st_addedgemodface('city_data',
+  5, 6,  'LINESTRING(36 38, 57 33)');
+SELECT 'T26', '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 (26, 17, 18)
+    UNION VALUES (4),(5) )
+  ORDER BY edge_id;
+
 ---------------------------------------------------------------------
 -- Check new relations and faces status
 ---------------------------------------------------------------------
index cbe0badd80090970470676a0fa6a3aa1dd4fb5a4..6899f73f62d3a7060dc19682d0ec5ea511b221b1 100644 (file)
@@ -143,6 +143,11 @@ T25|N31|
 T25|N32|2
 T25|N33|28
 T25|N34|31
+T26|E4|-52|52|24|32
+T26|E5|-4|5|32|32
+T26|E43|-44|44|32|0
+T26|E44|-43|43|0|32
+T26|E52|-5|4|32|24
 F3,F4|{3:3,3:4,3:10,3:16,3:17}
 F5,N4|{1:4,3:5,3:11}
 F0|
@@ -169,7 +174,7 @@ F20|POLYGON((3 11,3 17,9 17,9 11,3 11))
 F21|POLYGON((5 27,5 30,11 30,11 27,5 27))
 F22|POLYGON((22 27,22 30,28 30,28 27,22 27))
 F23|POLYGON((25 34,25 35,27 35,27 34,25 34))
-F24|POLYGON((35 25,35 45,63 45,63 25,35 25))
+F24|POLYGON((36 28,36 38,57 38,57 28,36 28))
 F25|POLYGON((9 0,9 6,21 6,21 0,9 0))
 F26|POLYGON((35 0,35 6,47 6,47 0,35 0))
 F27|POLYGON((35 -4,35 6,47 6,47 -4,35 -4))
@@ -177,4 +182,5 @@ F28|POLYGON((19.5 32.5,19.5 37.5,24.5 37.5,24.5 32.5,19.5 32.5))
 F29|POLYGON((25 30,25 37,29 37,29 30,25 30))
 F30|POLYGON((17 30,17 40,31 40,31 30,17 30))
 F31|POLYGON((19 31,19 38,26 38,26 31,19 31))
+F32|POLYGON((35 25,35 45,63 45,63 25,35 25))
 Topology 'city_data' dropped
index fc9b081b822b053b5f5d6f226475463d85959871..c85241c2f75f3106c3dd584fb8f0ab9b572f4a5e 100644 (file)
@@ -415,6 +415,18 @@ SELECT 'T25', 'N' || node_id, containing_face FROM
   city_data.node WHERE node_id IN ( 27, 31, 32, 33, 34 )
   ORDER BY node_id;
 
+--
+-- Split a face closing a ring inside a face
+--
+INSERT INTO newedge SELECT 26, topology.st_addedgenewfaces('city_data',
+  5, 6,  'LINESTRING(36 38, 57 33)');
+SELECT 'T26', '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 (26, 17, 18)
+    UNION VALUES (4),(5) )
+  ORDER BY edge_id;
+
 ---------------------------------------------------------------------
 -- Check new relations and faces status
 ---------------------------------------------------------------------
index 79079361a591cac06a36cc74b5572ef9d467deee..5d98cfd95871c4cb099d27cf5128ad408a7aa54a 100644 (file)
@@ -143,6 +143,11 @@ T25|N31|
 T25|N32|31
 T25|N33|41
 T25|N34|44
+T26|E4|-52|52|45|46
+T26|E5|-4|5|46|46
+T26|E43|-44|44|46|0
+T26|E44|-43|43|0|46
+T26|E52|-5|4|46|45
 F3,F4|{3:10,3:11,3:22,3:24,3:25}
 F5,N4|{1:4,3:12,3:13}
 F0|
@@ -168,7 +173,6 @@ 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((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))
@@ -177,4 +181,6 @@ F40|POLYGON((25 30,25 37,29 37,29 30,25 30))
 F41|POLYGON((19.5 32.5,19.5 37.5,24.5 37.5,24.5 32.5,19.5 32.5))
 F43|POLYGON((17 30,17 40,31 40,31 30,17 30))
 F44|POLYGON((19 31,19 38,26 38,26 31,19 31))
+F45|POLYGON((36 28,36 38,57 38,57 28,36 28))
+F46|POLYGON((35 25,35 45,63 45,63 25,35 25))
 Topology 'city_data' dropped