From 01ad3d3b53eaabeb2261734870ca99515e394865 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 24 Nov 2011 16:01:14 +0000 Subject: [PATCH] Shake legacy testcase a bit to avoid to mix population with queries git-svn-id: http://svn.osgeo.org/postgis/trunk@8236 b70326c6-7e19-0410-871a-916f4a2858ee --- topology/test/hierarchy.sql | 44 +++++-- topology/test/predicate.expected | 118 ------------------ topology/test/predicates.sql.in | 11 ++ topology/test/query_features.sql | 11 ++ .../test/regress/legacy_predicate_expected | 9 +- topology/test/regress/legacy_query_expected | 12 +- 6 files changed, 66 insertions(+), 139 deletions(-) delete mode 100644 topology/test/predicate.expected diff --git a/topology/test/hierarchy.sql b/topology/test/hierarchy.sql index d5d20cb2c..da80f9082 100644 --- a/topology/test/hierarchy.sql +++ b/topology/test/hierarchy.sql @@ -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 index dc8c2e184..000000000 --- a/topology/test/predicate.expected +++ /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 diff --git a/topology/test/predicates.sql.in b/topology/test/predicates.sql.in index 5b745a532..a910a1898 100644 --- a/topology/test/predicates.sql.in +++ b/topology/test/predicates.sql.in @@ -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; diff --git a/topology/test/query_features.sql b/topology/test/query_features.sql index 8aac77ce8..edf8e7a1d 100644 --- a/topology/test/query_features.sql +++ b/topology/test/query_features.sql @@ -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 diff --git a/topology/test/regress/legacy_predicate_expected b/topology/test/regress/legacy_predicate_expected index 516b5e0ac..74a99b659 100644 --- a/topology/test/regress/legacy_predicate_expected +++ b/topology/test/regress/legacy_predicate_expected @@ -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 diff --git a/topology/test/regress/legacy_query_expected b/topology/test/regress/legacy_query_expected index f2036a67b..2c80da1a1 100644 --- a/topology/test/regress/legacy_query_expected +++ b/topology/test/regress/legacy_query_expected @@ -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 -- 2.50.0