]> granicus.if.org Git - postgis/commitdiff
Test ST_GetFaceGeometry behavior when given face_id 0 (Universal Face). See ticket...
authorSandro Santilli <strk@keybit.net>
Tue, 24 May 2011 07:54:45 +0000 (07:54 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 24 May 2011 07:54:45 +0000 (07:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7224 b70326c6-7e19-0410-871a-916f4a2858ee

topology/test/regress/st_getfacegeometry.sql
topology/test/regress/st_getfacegeometry_expected

index a67fa0fd4e68592f5e40061a8ac11241bd5163cd..15f9d16c83911f9b7ab2e0f1484a46b24a007004 100644 (file)
@@ -2,14 +2,16 @@ set client_min_messages to WARNING;
 
 SELECT topology.CreateTopology('tt') > 0;
 
-COPY tt.face(face_id) FROM STDIN;
-1
-2
+COPY tt.face(face_id, mbr) FROM STDIN;
+1      POLYGON((0 0,0 10,10 10,10 0,0 0))
+2      POLYGON((2 2,2 8,8 8,8 2,2 2))
+3      POLYGON((12 2,12 8,18 8,18 2,12 2))
 \.
 
 COPY tt.node(node_id, geom) FROM STDIN;
 1      POINT(2 2)
 2      POINT(0 0)
+3      POINT(12 2)
 \.
 
 COPY tt.edge_data(
@@ -17,8 +19,9 @@ COPY tt.edge_data(
        abs_next_left_edge, abs_next_right_edge,
        next_left_edge, next_right_edge,
         left_face, right_face, geom) FROM STDIN;
-1      1       1       1       1       1       1       1       2       LINESTRING(2 2, 2  8,  8  8,  8 2, 2 2)
-2      2       2       2       2       2       2       0       1       LINESTRING(0 0, 0 10, 10 10, 10 0, 0 0)
+1      1       1       1       1       1       -1      1       2       LINESTRING(2 2, 2  8,  8  8,  8 2, 2 2)
+2      2       2       2       2       2       -2      0       1       LINESTRING(0 0, 0 10, 10 10, 10 0, 0 0)
+3      3       3       3       3       3       -3      0       3       LINESTRING(12 2, 12 8, 18 8, 18 2, 12 2)
 \.
 
 SELECT * FROM topology.ValidateTopology('tt');
@@ -28,4 +31,8 @@ SELECT * FROM topology.ValidateTopology('tt');
 SELECT 'f1 (with hole)', ST_asText(topology.st_getfacegeometry('tt', 1));
 SELECT 'f2 (fill hole)', ST_asText(topology.st_getfacegeometry('tt', 2));
 
+-- Universal face is the union of all faces
+-- See http://trac.osgeo.org/postgis/ticket/973
+SELECT 'f0', ST_AsText(topology.st_getfacegeometry('tt', 0));
+
 SELECT topology.DropTopology('tt');
index bd57b221655576b9cd95a0a80b227a68bb07288f..770bef25d501271a74eae339f5f1cad18bf93ee8 100644 (file)
@@ -1,4 +1,5 @@
 t
 f1 (with hole)|POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))
 f2 (fill hole)|POLYGON((2 2,2 8,8 8,8 2,2 2))
+f0|MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((12 2,12 8,18 8,18 2,12 2)))
 Topology 'tt' dropped