Commit 4a87bf83 authored by Regina Obe's avatar Regina Obe

Get rid of use of oids in topology regress was taken out in PostgreSQL 12.

Closes #4251 for PostGIS 2.5.2

git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17063 b70326c6-7e19-0410-871a-916f4a2858ee
parent 2ec11f8f
Pipeline #37711111 passed with stage
in 22 minutes and 37 seconds
......@@ -7,8 +7,8 @@
--
CREATE TABLE features.big_parcels (
feature_name varchar primary key
) WITH OIDS;
feature_name varchar primary key, fid serial
) ;
SELECT topology.AddTopoGeometryColumn('city_data', 'features',
'big_parcels', 'feature', 'POLYGON',
......@@ -17,21 +17,21 @@ SELECT topology.AddTopoGeometryColumn('city_data', 'features',
SELECT AddGeometryColumn('features','big_parcels','the_geom',-1,'MULTIPOLYGON',2);
INSERT INTO features.big_parcels VALUES ('P1P2', -- Feature name
INSERT INTO features.big_parcels(feature_name, feature) VALUES ('P1P2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
(SELECT layer_id FROM topology.layer WHERE table_name = 'big_parcels'),
'{{1,1},{2,1}}')); -- P1 and P2
INSERT INTO features.big_parcels VALUES ('P3P4', -- Feature name
INSERT INTO features.big_parcels(feature_name, feature) VALUES ('P3P4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
(SELECT layer_id FROM topology.layer WHERE table_name = 'big_parcels'),
'{{3,1},{4,1}}')); -- P3 and P4
INSERT INTO features.big_parcels VALUES ('F3F6', -- Feature name
INSERT INTO features.big_parcels(feature_name, feature) VALUES ('F3F6', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -46,15 +46,15 @@ INSERT INTO features.big_parcels VALUES ('F3F6', -- Feature name
--
CREATE TABLE features.big_streets (
feature_name varchar primary key
) WITH OIDS;
feature_name varchar primary key, fid serial
) ;
SELECT topology.AddTopoGeometryColumn('city_data', 'features',
'big_streets', 'feature', 'LINE',
3 -- the city_streets layer id
);
INSERT INTO features.big_streets VALUES ('R1R2', -- Feature name
INSERT INTO features.big_streets(feature_name, feature)VALUES ('R1R2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (lineal)
......@@ -64,7 +64,7 @@ INSERT INTO features.big_streets VALUES ('R1R2', -- Feature name
WHERE feature_name in ('R1','R2')) -- R1 and R2
));
INSERT INTO features.big_streets VALUES ('R4', -- Feature name
INSERT INTO features.big_streets(feature_name, feature) VALUES ('R4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (lineal)
......@@ -79,17 +79,17 @@ INSERT INTO features.big_streets VALUES ('R4', -- Feature name
--
CREATE TABLE features.big_signs (
feature_name varchar primary key
) WITH OIDS;
feature_name varchar primary key, fid serial
) ;
SELECT topology.AddTopoGeometryColumn('city_data', 'features',
'big_signs', 'feature', 'POINT',
2 -- the traffic_signs
);
SELECT AddGeometryColumn('features','big_signs','the_geom',-1,'MULTIPOINT',2);
SELECT AddGeometryColumn('features','big_signs','the_geom',0,'MULTIPOINT',2);
INSERT INTO features.big_signs VALUES ('S1S2', -- Feature name
INSERT INTO features.big_signs(feature_name, feature) VALUES ('S1S2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point/multipoint)
......
......@@ -24,11 +24,11 @@ BEGIN;
CREATE SCHEMA features;
CREATE TABLE features.land_parcels ( -- Land parcels (selected faces)
feature_name VARCHAR PRIMARY KEY) with oids;
feature_name VARCHAR PRIMARY KEY, fid serial);
CREATE TABLE features.city_streets ( -- City streets (selected edges)
feature_name VARCHAR PRIMARY KEY) with oids;
feature_name VARCHAR PRIMARY KEY, fid serial);
CREATE TABLE features.traffic_signs ( -- Traffic signs (selected nodes)
feature_name VARCHAR PRIMARY KEY) with oids;
feature_name VARCHAR PRIMARY KEY, fid serial);
-- 4. Associate feature tables with the topology.
-- Add the three topology geometry layers to the CITY_DATA topology.
......@@ -55,7 +55,7 @@ SELECT topology.AddTopoGeometryColumn('city_data', 'features', 'city_streets','f
-- 6A. Load LAND_PARCELS table.
-- P1
INSERT INTO features.land_parcels VALUES ('P1', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P1', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -64,28 +64,28 @@ INSERT INTO features.land_parcels VALUES ('P1', -- Feature name
);
-- P2
INSERT INTO features.land_parcels VALUES ('P2', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
1, -- TG_LAYER_ID for this topology (from ALL_SDO_TOPO_METADATA)
'{{4,3},{7,3}}'));
-- P3
INSERT INTO features.land_parcels VALUES ('P3', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
1, -- TG_LAYER_ID for this topology (from topology.layer)
'{{5,3},{8,3}}'));
-- P4
INSERT INTO features.land_parcels VALUES ('P4', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
1, -- TG_LAYER_ID for this topology (from topology.layer)
'{{2,3}}'));
-- P5 (Includes F1, but not F9.)
INSERT INTO features.land_parcels VALUES ('P5', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P5', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -94,28 +94,28 @@ INSERT INTO features.land_parcels VALUES ('P5', -- Feature name
-- 6B. Load TRAFFIC_SIGNS table.
-- S1
INSERT INTO features.traffic_signs VALUES ('S1', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('S1', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{14,1}}'));
-- S2
INSERT INTO features.traffic_signs VALUES ('S2', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('S2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{13,1}}'));
-- S3
INSERT INTO features.traffic_signs VALUES ('S3', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('S3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{6,1}}'));
-- S4
INSERT INTO features.traffic_signs VALUES ('S4', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('S4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
......@@ -125,28 +125,28 @@ INSERT INTO features.traffic_signs VALUES ('S4', -- Feature name
-- 6C. Load CITY_STREETS table.
-- (Note: "R" in feature names is for "Road", because "S" is used for signs.)
-- R1
INSERT INTO features.city_streets VALUES ('R1', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('R1', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{9,2},{-10,2}}')); -- E9, E10
-- R2
INSERT INTO features.city_streets VALUES ('R2', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('R2', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{4,2},{-5,2}}')); -- E4, E5
-- R3
INSERT INTO features.city_streets VALUES ('R3', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('R3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{25,2}}'));
-- R4
INSERT INTO features.city_streets VALUES ('R4', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('R4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
......
......@@ -2,7 +2,7 @@
-- More parcels
INSERT INTO features.land_parcels VALUES ('F3', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('F3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -10,7 +10,7 @@ INSERT INTO features.land_parcels VALUES ('F3', -- Feature name
'{{3,3}}') -- face_id:3
);
INSERT INTO features.land_parcels VALUES ('F6', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('F6', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -18,7 +18,7 @@ INSERT INTO features.land_parcels VALUES ('F6', -- Feature name
'{{6,3}}') -- face_id:3
);
INSERT INTO features.land_parcels VALUES ('F3F4', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('F3F4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -26,7 +26,7 @@ INSERT INTO features.land_parcels VALUES ('F3F4', -- Feature name
'{{3,3},{4,3}}') -- face_id:3 face_id:4
);
INSERT INTO features.land_parcels VALUES ('F1', -- Feature name
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('F1', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......@@ -36,28 +36,28 @@ INSERT INTO features.land_parcels VALUES ('F1', -- Feature name
-- More TRAFFIC_SIGNS
INSERT INTO features.traffic_signs VALUES ('N1N2N3', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('N1N2N3', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{1,1},{2,1},{3,1}}'));
INSERT INTO features.traffic_signs VALUES ('N1N6N14', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('N1N6N14', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{1,1},{6,1},{14,1}}'));
INSERT INTO features.traffic_signs VALUES ('N3N4', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('N3N4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
2, -- TG_LAYER_ID for this topology (from topology.layer)
'{{3,1},{4,1}}'));
INSERT INTO features.traffic_signs VALUES ('N4', -- Feature name
INSERT INTO features.traffic_signs(feature_name, feature) VALUES ('N4', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
1, -- Topology geometry type (point)
......@@ -66,28 +66,28 @@ INSERT INTO features.traffic_signs VALUES ('N4', -- Feature name
-- More STREETS
INSERT INTO features.city_streets VALUES ('E7E8', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('E7E8', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{7,2},{8,2}}'));
INSERT INTO features.city_streets VALUES ('E20E19', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('E20E19', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{20,2},{19,2}}'));
INSERT INTO features.city_streets VALUES ('E25', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('E25', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
3, -- TG_LAYER_ID for this topology (from topology.layer)
'{{-25,2}}'));
INSERT INTO features.city_streets VALUES ('R1a', -- Feature name
INSERT INTO features.city_streets(feature_name, feature) VALUES ('R1a', -- Feature name
topology.CreateTopoGeom(
'city_data', -- Topology name
2, -- Topology geometry type (line string)
......
......@@ -22,7 +22,7 @@ SELECT 'POINT/POINT INTERSECTS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.traffic_signs a, features.traffic_signs b
WHERE a.oid < b.oid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
#endif
......@@ -46,7 +46,7 @@ SELECT 'LINE/LINE INTERSECTS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.city_streets a, features.city_streets b
WHERE a.oid < b.oid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
#endif
#if DO_POINT_POLYGON_INTERSECTS
......@@ -79,7 +79,7 @@ SELECT 'POLY/POLY INTERSECTS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.land_parcels a, features.land_parcels b
WHERE a.oid < b.oid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@intersects(a.@COLUMN@, b.@COLUMN@);
#endif
#if DO_POINT_POINT_EQUALS
......@@ -88,7 +88,7 @@ SELECT 'POINT/POINT EQUALS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.traffic_signs a, features.traffic_signs b
WHERE a.oid < b.oid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
#endif
......@@ -98,7 +98,7 @@ SELECT 'LINE/LINE EQUALS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.city_streets a, features.city_streets b
WHERE a.oid < b.oid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
#endif
......@@ -108,7 +108,7 @@ SELECT 'POLYGON/POLYGON EQUALS' as operation;
SELECT a.feature_name, b.feature_name FROM
features.land_parcels a, features.land_parcels b
WHERE a.oid < b.oid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
WHERE a.fid < b.fid AND @SCHEMA@equals(a.@COLUMN@, b.@COLUMN@);
#endif
......@@ -116,15 +116,15 @@ 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;
WHERE a.fid < b.fid AND @SCHEMA@equals(a.feature, b.feature)
ORDER BY a.feature_name;
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;
WHERE a.fid < b.fid AND @SCHEMA@equals(a.feature, b.feature)
ORDER BY a.feature_name;
END;
......@@ -80,7 +80,7 @@ SELECT 'E' || TopoGeo_addLinestring('city_data', 'LINESTRING(10 48, 16 48, 16 50
-- And this defines a new feature including both face 1and the new
-- wrapping face 11 plus the new (holed) face 12
INSERT INTO features.land_parcels VALUES ('P6',
INSERT INTO features.land_parcels(feature_name, feature) VALUES ('P6',
topology.CreateTopoGeom(
'city_data', -- Topology name
3, -- Topology geometry type (polygon/multipolygon)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment