]> granicus.if.org Git - postgis/commitdiff
Shake legacy testcase a bit to avoid to mix population with queries
authorSandro Santilli <strk@keybit.net>
Thu, 24 Nov 2011 16:01:14 +0000 (16:01 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 24 Nov 2011 16:01:14 +0000 (16:01 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8236 b70326c6-7e19-0410-871a-916f4a2858ee

topology/test/hierarchy.sql
topology/test/predicate.expected [deleted file]
topology/test/predicates.sql.in
topology/test/query_features.sql
topology/test/regress/legacy_predicate_expected
topology/test/regress/legacy_query_expected

index d5d20cb2c6e91c46f5b508884a2dad6144e84c24..da80f90827df49925051debd07622cff4178d5cf 100644 (file)
@@ -8,7 +8,7 @@
 
 CREATE TABLE features.big_parcels (
        feature_name varchar primary key
-);
+) WITH OIDS;
 
 SELECT topology.AddTopoGeometryColumn('city_data', 'features',
        'big_parcels', 'feature', 'POLYGON',
@@ -38,11 +38,38 @@ INSERT INTO features.big_parcels VALUES ('F3F6', -- Feature name
     (SELECT layer_id FROM topology.layer WHERE table_name = 'big_parcels'),
     '{{6,1},{7,1}}')); -- F3 and F6
 
-SELECT feature_name,ST_AsText(topology.geometry(feature)) from features.big_parcels;
+--
+-- Streets
+--
+
+CREATE TABLE features.big_streets (
+       feature_name varchar primary key
+) WITH OIDS;
+
+SELECT topology.AddTopoGeometryColumn('city_data', 'features',
+       'big_streets', 'feature', 'LINE',
+       3 -- the city_streets layer id
+);
 
-SELECT a.feature_name, b.feature_name
-       FROM features.land_parcels a, features.big_parcels b
-       WHERE topology.equals(a.feature, b.feature);
+INSERT INTO features.big_streets VALUES ('R1R2', -- Feature name
+  topology.CreateTopoGeom(
+    'city_data', -- Topology name
+    2, -- Topology geometry type (lineal)
+    (SELECT layer_id FROM topology.layer WHERE table_name = 'big_streets'),
+    (SELECT topoelementarray_agg(ARRAY[id(feature), 3])
+     FROM features.city_streets
+     WHERE feature_name in ('R1','R2')) -- R1 and R2
+  ));
+
+INSERT INTO features.big_streets VALUES ('R4', -- Feature name
+  topology.CreateTopoGeom(
+    'city_data', -- Topology name
+    2, -- Topology geometry type (lineal)
+    (SELECT layer_id FROM topology.layer WHERE table_name = 'big_streets'),
+    (SELECT topoelementarray_agg(ARRAY[id(feature), 3])
+     FROM features.city_streets
+     WHERE feature_name in ('R4')) 
+  )); 
 
 --
 -- Signs
@@ -50,7 +77,7 @@ SELECT a.feature_name, b.feature_name
 
 CREATE TABLE features.big_signs (
        feature_name varchar primary key
-);
+) WITH OIDS;
 
 SELECT topology.AddTopoGeometryColumn('city_data', 'features',
        'big_signs', 'feature', 'POINT',
@@ -66,8 +93,3 @@ INSERT INTO features.big_signs VALUES ('S1S2', -- Feature name
     (SELECT layer_id FROM topology.layer WHERE table_name = 'big_signs'),
     '{{1,2},{2,2}}')); -- S1 and S2
 
-SELECT feature_name, ST_AsText(topology.geometry(feature)) from features.big_signs;
-
-SELECT a.feature_name, b.feature_name
-       FROM features.traffic_signs a, features.big_signs b
-       WHERE topology.equals(a.feature, b.feature);
diff --git a/topology/test/predicate.expected b/topology/test/predicate.expected
deleted file mode 100644 (file)
index dc8c2e1..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-BEGIN
- POINT/POINT INTERSECTS
-
- S1           | N1N6N14
- S3           | N1N6N14
- S4           | N3N4
- S4           | N4
- N1N2N3       | N1N6N14
- N1N2N3       | N3N4
- N3N4         | N4
-
- POINT/LINE INTERSECTS
-
- S1           | R1
- S1           | E20E19
- S1           | R1a
- S2           | R1
- S2           | R1a
- S3           | R2
- N1N2N3       | R4
- N1N6N14      | R1
- N1N6N14      | R2
- N1N6N14      | E20E19
- N1N6N14      | R1a
- N3N4         | R4
-
- LINE/LINE INTERSECTS
-
- R1           | E20E19
- R1           | R1a
- R3           | E25
- E7E8         | E20E19
- E20E19       | R1a
-
- POINT/POLY INTERSECTS
-
- S1           | P1
- S1           | P2
- S1           | F3
- S1           | F6
- S1           | F3F4
- S2           | P2
- S2           | P3
- S2           | F3F4
- S4           | P4
- N1N2N3       | P4
- N1N2N3       | P5
- N1N2N3       | F1
- N1N6N14      | P1
- N1N6N14      | P2
- N1N6N14      | P5
- N1N6N14      | F3
- N1N6N14      | F6
- N1N6N14      | F3F4
- N1N6N14      | F1
- N3N4         | P4
- N4           | P4
-
- LINE/POLY INTERSECTS
-
- R1           | P1
- R1           | P2
- R1           | P3
- R1           | F3
- R1           | F6
- R1           | F3F4
- R3           | P5
- R3           | F1
- R4           | P4
- E7E8         | P1
- E7E8         | P2
- E7E8         | P3
- E7E8         | F3
- E7E8         | F3F4
- E20E19       | P1
- E20E19       | P2
- E20E19       | F3
- E20E19       | F6
- E20E19       | F3F4
- E25          | P5
- E25          | F1
- R1a          | P1
- R1a          | P2
- R1a          | P3
- R1a          | F3
- R1a          | F6
- R1a          | F3F4
-
- POLY/POLY INTERSECTS
-
- P1           | P2
- P1           | F3
- P1           | F6
- P1           | F3F4
- P2           | P3
- P2           | F3
- P2           | F6
- P2           | F3F4
- P3           | F3F4
- P5           | F1
- F3           | F6
- F3           | F3F4
- F6           | F3F4
-
- POINT/POINT EQUALS
-
- S4           | N4
-
- LINE/LINE EQUALS
-
- R1           | R1a
- R3           | E25
-
- POLYGON/POLYGON EQUALS
-
- P5           | F1
-
-COMMIT
index 5b745a5324e0fcac30e55ebb7edc2123f7ec3537..a910a1898e134adb5153d068e2ee523b5e500dde 100644 (file)
@@ -114,8 +114,19 @@ SELECT a.feature_name, b.feature_name FROM
 
 #endif
 
+SELECT 'POINT/POINT EQUALS (simple/hierarchical)' as operation;
 
+SELECT a.feature_name, b.feature_name
+       FROM features.traffic_signs a, features.big_signs b
+       WHERE a.oid < b.oid AND @SCHEMA@equals(a.feature, b.feature)
+       ORDER BY a.oid;
 
+SELECT 'POLYGON/POLYGON EQUALS (simple/hierarchical)' as operation;
+
+SELECT a.feature_name, b.feature_name
+       FROM features.land_parcels a, features.big_parcels b
+       WHERE a.oid < b.oid AND @SCHEMA@equals(a.feature, b.feature)
+       ORDER BY a.oid;
 
 END;
 
index 8aac77ce8189849673023c5a53cf3012f07e72f0..edf8e7a1dd0efcf5558b4284f4a3c14b0d7267d5 100644 (file)
@@ -33,6 +33,17 @@ SELECT a.feature_name, id(a.feature) as tg_id,
        ST_AsText(topology.Geometry(a.feature)) as geom
 FROM features.city_streets a;
 
+-- Query hierarchical feautures
+SELECT feature_name, ST_AsText(topology.geometry(feature))
+FROM features.big_signs;
+
+SELECT feature_name,ST_AsText(topology.geometry(feature))
+FROM features.big_streets;
+
+SELECT feature_name,ST_AsText(topology.geometry(feature))
+FROM features.big_parcels;
+
+
 --NOTYET--
 --NOTYET--/* Window is city_streets */
 --NOTYET--SELECT a.feature_name, b.feature_name
index 516b5e0ac0456c49fc5ea55213a43561407d301e..74a99b659b0f85813337e329dbcb444c9d4c4bb4 100644 (file)
@@ -11,13 +11,9 @@ BEGIN
 COMMIT
 4
 features.big_parcels.the_geom SRID:0 TYPE:MULTIPOLYGON DIMS:2 
-P1P2|POLYGON((21 6,9 6,9 14,9 22,21 22,35 22,35 14,35 6,21 6))
-P3P4|MULTIPOLYGON(((47 14,47 6,35 6,35 14,35 22,47 22,47 14)),((25 30,17 30,17 40,31 40,31 30,25 30)))
-F3F6|POLYGON((21 14,21 6,9 6,9 14,9 22,21 22,21 14))
-P1|F3F6
 5
+6
 features.big_signs.the_geom SRID:0 TYPE:MULTIPOINT DIMS:2 
-S1S2|MULTIPOINT(21 14,35 14)
 BEGIN
 POINT/POINT INTERSECTS
 S1|N1N6N14
@@ -117,5 +113,8 @@ R1|R1a
 R3|E25
 POLYGON/POLYGON EQUALS
 P5|F1
+POINT/POINT EQUALS (simple/hierarchical)
+POLYGON/POLYGON EQUALS (simple/hierarchical)
+P1|F3F6
 COMMIT
 Topology 'city_data' dropped
index f2036a67ba57a75bf61a889396f8cf34e00db883..2c80da1a1b9468a299957a007d63af6eb21dd6b9 100644 (file)
@@ -11,13 +11,9 @@ BEGIN
 COMMIT
 4
 features.big_parcels.the_geom SRID:0 TYPE:MULTIPOLYGON DIMS:2 
-P1P2|POLYGON((21 6,9 6,9 14,9 22,21 22,35 22,35 14,35 6,21 6))
-P3P4|MULTIPOLYGON(((47 14,47 6,35 6,35 14,35 22,47 22,47 14)),((25 30,17 30,17 40,31 40,31 30,25 30)))
-F3F6|POLYGON((21 14,21 6,9 6,9 14,9 22,21 22,21 14))
-P1|F3F6
 5
+6
 features.big_signs.the_geom SRID:0 TYPE:MULTIPOINT DIMS:2 
-S1S2|MULTIPOINT(21 14,35 14)
 BEGIN
 P1|1|POLYGON((21 14,21 6,9 6,9 14,9 22,21 22,21 14))
 P2|2|POLYGON((35 14,35 6,21 6,21 14,21 22,35 22,35 14))
@@ -44,5 +40,11 @@ E7E8|5|LINESTRING(21 22,35 22,47 22)
 E20E19|6|LINESTRING(21 6,21 14,21 22)
 E25|7|LINESTRING(9 35,13 35)
 R1a|8|LINESTRING(9 14,21 14,35 14)
+S1S2|MULTIPOINT(21 14,35 14)
+R1R2|MULTILINESTRING((36 38,38 35,41 34,42 33,45 32,47 28,50 28,52 32,57 33,57 36,59 39,61 38,62 41,47 42,45 40,41 40),(9 14,21 14,35 14))
+R4|LINESTRING(25 30,25 35)
+P1P2|POLYGON((21 6,9 6,9 14,9 22,21 22,35 22,35 14,35 6,21 6))
+P3P4|MULTIPOLYGON(((47 14,47 6,35 6,35 14,35 22,47 22,47 14)),((25 30,17 30,17 40,31 40,31 30,25 30)))
+F3F6|POLYGON((21 14,21 6,9 6,9 14,9 22,21 22,21 14))
 COMMIT
 Topology 'city_data' dropped