[postgis-tickets] r17252 - Update OGC certification scripts to match new function signatures
Paul Ramsey
pramsey at cleverelephant.ca
Fri Feb 15 10:52:39 PST 2019
Author: pramsey
Date: 2019-02-15 10:52:38 -0800 (Fri, 15 Feb 2019)
New Revision: 17252
Modified:
trunk/extras/ogc_test_suite/1_schema.sql
trunk/extras/ogc_test_suite/2_queries.sql
trunk/extras/ogc_test_suite/Makefile
Log:
Update OGC certification scripts to match new function signatures
Modified: trunk/extras/ogc_test_suite/1_schema.sql
===================================================================
--- trunk/extras/ogc_test_suite/1_schema.sql 2019-02-13 22:23:14 UTC (rev 17251)
+++ trunk/extras/ogc_test_suite/1_schema.sql 2019-02-15 18:52:38 UTC (rev 17252)
@@ -157,9 +157,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'POLYGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -176,9 +176,9 @@
-- ---------------------
CREATE TABLE lakes (
fid INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(64)
+ name VARCHAR(64),
+ shore GEOMETRY(Polygon, 101)
);
-SELECT AddGeometryColumn('lakes','shore','101','POLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -189,9 +189,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'LINESTRING' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -213,9 +213,9 @@
fid INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(64),
aliases VARCHAR(64),
- num_lanes INTEGER
+ num_lanes INTEGER,
+ centerline GEOMETRY(LineString, 101)
);
-SELECT AddGeometryColumn('road_segments','centerline','101','LINESTRING','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -228,9 +228,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'MULTILINESTRING' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -249,9 +249,9 @@
CREATE TABLE divided_routes (
fid INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(64),
- num_lanes INTEGER
+ num_lanes INTEGER,
+ centerlines GEOMETRY(multilinestring, 101)
);
-SELECT AddGeometryColumn('divided_routes','centerlines','101','MULTILINESTRING','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -264,9 +264,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'MULTIPOLYGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -283,9 +283,9 @@
-- ---------------------
CREATE TABLE forests (
fid INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(64)
+ name VARCHAR(64),
+ boundary GEOMETRY(MultiPolygon, 101)
);
-SELECT AddGeometryColumn('forests','boundary','101','MULTIPOLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -298,9 +298,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'POINT' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -317,9 +317,9 @@
-- ---------------------
CREATE TABLE bridges (
fid INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(64)
+ name VARCHAR(64),
+ position GEOMETRY(Point, 101)
);
-SELECT AddGeometryColumn('bridges','position','101','POINT','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -330,9 +330,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'LINESTRING' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -349,9 +349,9 @@
-- ---------------------
CREATE TABLE streams (
fid INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(64)
+ name VARCHAR(64),
+ centerline GEOMETRY(LineString, 101)
);
-SELECT AddGeometryColumn('streams','centerline','101','LINESTRING','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -369,9 +369,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'POINT', 'POLYGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -389,10 +389,10 @@
-- ---------------------
CREATE TABLE buildings (
fid INTEGER NOT NULL PRIMARY KEY,
- address VARCHAR(64)
+ address VARCHAR(64),
+ position GEOMETRY(Point, 101),
+ footprint GEOMETRY(Polygon, 101)
);
-SELECT AddGeometryColumn('buildings','position','101','POINT','2');
-SELECT AddGeometryColumn('buildings','footprint','101','POLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -405,9 +405,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'MULTIPOYLGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -426,9 +426,9 @@
CREATE TABLE ponds (
fid INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(64),
- type VARCHAR(64)
+ type VARCHAR(64),
+ shores GEOMETRY(MultiPolygon, 101)
);
-SELECT AddGeometryColumn('ponds','shores','101','MULTIPOLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -441,9 +441,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'POLYGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -461,9 +461,9 @@
-- ---------------------
CREATE TABLE named_places (
fid INTEGER NOT NULL PRIMARY KEY,
- name VARCHAR(64)
+ name VARCHAR(64),
+ boundary GEOMETRY(Polygon, 101)
);
-SELECT AddGeometryColumn('named_places','boundary','101','POLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -475,9 +475,9 @@
--
--
-- !#@ ADAPTATION BEGIN
--- We break the schema creation into two steps, first create the
--- attribute table, second use the AddGeometryColumn() function
--- to create and register the geometry column.
+-- We declare the geometry column type using 'GEOMETRY'
+-- as the type with 'POLYGON' and 101 as type modifiers
+-- to enforce the geometry type and SRID.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -492,9 +492,9 @@
-- -- BEGIN ADAPTED SQL
-- ---------------------
CREATE TABLE map_neatlines (
- fid INTEGER NOT NULL PRIMARY KEY
+ fid INTEGER NOT NULL PRIMARY KEY,
+ neatline GEOMETRY(Polygon, 101)
);
-SELECT AddGeometryColumn('map_neatlines','neatline','101','POLYGON','2');
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -527,7 +527,7 @@
--
--
INSERT INTO lakes VALUES (101, 'Blue Lake',
- PolygonFromText('POLYGON((52 18,66 23,73 9,48 6,52 18),(59 18,67 18,67 13,59 13,59 18))', 101)
+ ST_GeomFromText('POLYGON((52 18,66 23,73 9,48 6,52 18),(59 18,67 18,67 13,59 13,59 18))', 101)
);
--
--==================
@@ -550,19 +550,19 @@
--
--
INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2,
- LineStringFromText('LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)
+ ST_GeomFromText('LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)
);
INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4,
- LineStringFromText('LINESTRING( 44 31, 56 34, 70 38 )' ,101)
+ ST_GeomFromText('LINESTRING( 44 31, 56 34, 70 38 )' ,101)
);
INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2,
- LineStringFromText('LINESTRING( 70 38, 72 48 )' ,101)
+ ST_GeomFromText('LINESTRING( 70 38, 72 48 )' ,101)
);
INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4,
- LineStringFromText('LINESTRING( 70 38, 84 42 )' ,101)
+ ST_GeomFromText('LINESTRING( 70 38, 84 42 )' ,101)
);
INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, 1,
- LineStringFromText('LINESTRING( 28 26, 28 0 )',101)
+ ST_GeomFromText('LINESTRING( 28 26, 28 0 )',101)
);
--
--==================
@@ -575,7 +575,7 @@
--==================
--
INSERT INTO divided_routes VALUES(119, 'Route 75', 4,
- MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))', 101)
+ ST_GeomFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))', 101)
);
--
--==================
@@ -590,7 +590,7 @@
--==================
--
INSERT INTO forests VALUES(109, 'Green Forest',
- MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', 101)
+ ST_GeomFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', 101)
);
--
--==================
@@ -603,7 +603,7 @@
--==================
--
INSERT INTO bridges VALUES(110, 'Cam Bridge',
- PointFromText('POINT( 44 31 )', 101)
+ ST_GeomFromText('POINT( 44 31 )', 101)
);
--
--==================
@@ -617,10 +617,10 @@
--==================
--
INSERT INTO streams VALUES(111, 'Cam Stream',
- LineStringFromText('LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)
+ ST_GeomFromText('LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)
);
INSERT INTO streams VALUES(112, NULL,
- LineStringFromText('LINESTRING( 76 0, 78 4, 73 9 )', 101)
+ ST_GeomFromText('LINESTRING( 76 0, 78 4, 73 9 )', 101)
);
--
--==================
@@ -638,12 +638,12 @@
--==================
--
INSERT INTO buildings VALUES(113, '123 Main Street',
- PointFromText('POINT( 52 30 )', 101),
- PolygonFromText('POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)
+ ST_GeomFromText('POINT( 52 30 )', 101),
+ ST_GeomFromText('POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)
);
INSERT INTO buildings VALUES(114, '215 Main Street',
- PointFromText('POINT( 64 33 )', 101),
- PolygonFromText('POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)
+ ST_GeomFromText('POINT( 64 33 )', 101),
+ ST_GeomFromText('POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)
);
--
--==================
@@ -656,7 +656,7 @@
--==================
--
INSERT INTO ponds VALUES(120, NULL, 'Stock Pond',
- MultiPolygonFromText('MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)
+ ST_GeomFromText('MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)
);
--
--==================
@@ -672,10 +672,10 @@
--==================
--
INSERT INTO named_places VALUES(117, 'Ashton',
- PolygonFromText('POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)
+ ST_GeomFromText('POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)
);
INSERT INTO named_places VALUES(118, 'Goose Island',
- PolygonFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)
+ ST_GeomFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)
);
--
--==================
@@ -688,7 +688,7 @@
--==================
--
INSERT INTO map_neatlines VALUES(115,
- PolygonFromText('POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)
+ ST_GeomFromText('POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)
);
--
--
Modified: trunk/extras/ogc_test_suite/2_queries.sql
===================================================================
--- trunk/extras/ogc_test_suite/2_queries.sql 2019-02-13 22:23:14 UTC (rev 17251)
+++ trunk/extras/ogc_test_suite/2_queries.sql 2019-02-15 18:52:38 UTC (rev 17252)
@@ -187,6 +187,11 @@
--
--//////////////////////////////////////////////////////////////////////////////
--
+-- -- !#@ ADAPTATION BEGIN
+-- All functions are now prefixed with "ST_" in accordance with SFSQL 1.2
+-- and ISO SQL/MM Part 2
+-- -- !#@ ADAPTATION END
+--
--================================
-- Conformance Item T6
-- Dimension(g Geometry) : Integer
@@ -196,7 +201,7 @@
--
--================================
--
-SELECT Dimension(shore)
+SELECT ST_Dimension(shore)
FROM lakes
WHERE name = 'Blue Lake';
--
@@ -225,7 +230,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT GeometryType(centerlines)
+SELECT ST_GeometryType(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
-- ---------------------
@@ -242,7 +247,7 @@
--
--================================
--
-SELECT AsText(boundary)
+SELECT ST_AsText(boundary)
FROM named_places
WHERE name = 'Goose Island';
--
@@ -257,7 +262,7 @@
--
--================================
--
-SELECT AsText(PolygonFromWKB(AsBinary(boundary)))
+SELECT ST_AsText(ST_PolygonFromWKB(ST_AsBinary(boundary)))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -270,7 +275,7 @@
--
--================================
--
-SELECT SRID(boundary)
+SELECT ST_SRID(boundary)
FROM named_places
WHERE name = 'Goose Island';
--
@@ -288,7 +293,7 @@
--
--================================
--
-SELECT IsEmpty(centerline)
+SELECT ST_IsEmpty(centerline)
FROM road_segments
WHERE name = 'Route 5' AND aliases = 'Main Street';
--
@@ -306,7 +311,7 @@
--
--================================
--
-SELECT IsSimple(shore)
+SELECT ST_IsSimple(shore)
FROM lakes
WHERE name = 'Blue Lake';
--
@@ -334,7 +339,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(Boundary(boundary))
+SELECT ST_AsText(ST_Boundary(boundary))
FROM named_places
WHERE name = 'Goose Island';
-- ---------------------
@@ -365,7 +370,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(Envelope(boundary))
+SELECT ST_AsText(ST_Envelope(boundary))
FROM named_places
WHERE name = 'Goose Island';
-- ---------------------
@@ -404,7 +409,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT X(position)
+SELECT ST_X(position)
FROM bridges
WHERE name = 'Cam Bridge';
-- ---------------------
@@ -421,7 +426,7 @@
--
--================================
--
-SELECT Y(position)
+SELECT ST_Y(position)
FROM bridges
WHERE name = 'Cam Bridge';
--
@@ -442,7 +447,7 @@
--
--================================
--
-SELECT AsText(StartPoint(centerline))
+SELECT ST_AsText(ST_StartPoint(centerline))
FROM road_segments
WHERE fid = 102;
--
@@ -455,7 +460,7 @@
--
--================================
--
-SELECT AsText(EndPoint(centerline))
+SELECT ST_AsText(ST_EndPoint(centerline))
FROM road_segments
WHERE fid = 102;
--
@@ -472,7 +477,7 @@
--
--================================
--
-SELECT IsClosed(Boundary(boundary))
+SELECT ST_IsClosed(ST_Boundary(boundary))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -489,7 +494,7 @@
--
--================================
--
-SELECT IsRing(Boundary(boundary))
+SELECT ST_IsRing(ST_Boundary(boundary))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -502,7 +507,7 @@
--
--================================
--
-SELECT Length(centerline)
+SELECT ST_Length(centerline)
FROM road_segments
WHERE fid = 106;
--
@@ -523,7 +528,7 @@
--
--================================
--
-SELECT NumPoints(centerline)
+SELECT ST_NumPoints(centerline)
FROM road_segments
WHERE fid = 102;
--
@@ -536,7 +541,7 @@
--
--================================
--
-SELECT AsText(PointN(centerline, 1))
+SELECT ST_AsText(ST_PointN(centerline, 1))
FROM road_segments
WHERE fid = 102;
--
@@ -557,7 +562,7 @@
--
--================================
--
-SELECT AsText(Centroid(boundary))
+SELECT ST_AsText(ST_Centroid(boundary))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -576,7 +581,7 @@
--
--================================
--
-SELECT Contains(boundary, PointOnSurface(boundary))
+SELECT ST_Contains(boundary, ST_PointOnSurface(boundary))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -589,7 +594,7 @@
--
--================================
--
-SELECT Area(boundary)
+SELECT ST_Area(boundary)
FROM named_places
WHERE name = 'Goose Island';
--
@@ -610,7 +615,7 @@
--
--================================
--
-SELECT AsText(ExteriorRing(shore))
+SELECT ST_AsText(ST_ExteriorRing(shore))
FROM lakes
WHERE name = 'Blue Lake';
--
@@ -623,7 +628,7 @@
--
--================================
--
-SELECT NumInteriorRings(shore)
+SELECT ST_NumInteriorRings(shore)
FROM lakes
WHERE name = 'Blue Lake';
--
@@ -636,7 +641,7 @@
--
--================================
--
-SELECT AsText(InteriorRingN(shore, 1))
+SELECT ST_AsText(ST_InteriorRingN(shore, 1))
FROM lakes
WHERE name = 'Blue Lake';
--
@@ -657,7 +662,7 @@
--
--================================
--
-SELECT NumGeometries(centerlines)
+SELECT ST_NumGeometries(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--
@@ -685,7 +690,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(GeometryN(centerlines, 2))
+SELECT ST_AsText(ST_GeometryN(centerlines, 2))
FROM divided_routes
WHERE name = 'Route 75';
-- ---------------------
@@ -714,7 +719,7 @@
--
--================================
--
-SELECT IsClosed(centerlines)
+SELECT ST_IsClosed(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--
@@ -728,7 +733,7 @@
--
--================================
--
-SELECT Length(centerlines)
+SELECT ST_Length(centerlines)
FROM divided_routes
WHERE name = 'Route 75';
--
@@ -749,7 +754,7 @@
--
--================================
--
-SELECT AsText(Centroid(shores))
+SELECT ST_AsText(ST_Centroid(shores))
FROM ponds
WHERE fid = 120;
--
@@ -768,7 +773,7 @@
--
--================================
--
-SELECT Contains(shores, PointOnSurface(shores))
+SELECT ST_Contains(shores, ST_PointOnSurface(shores))
FROM ponds
WHERE fid = 120;
--
@@ -781,7 +786,7 @@
--
--================================
--
-SELECT Area(shores)
+SELECT ST_Area(shores)
FROM ponds
WHERE fid = 120;
--
@@ -807,7 +812,7 @@
--
--================================
--
-SELECT Equals(boundary, PolygonFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1))
+SELECT ST_Equals(boundary, ST_PolygonFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',101))
FROM named_places
WHERE name = 'Goose Island';
--
@@ -825,7 +830,7 @@
--
--================================
--
-SELECT Disjoint(centerlines, boundary)
+SELECT ST_Disjoint(centerlines, boundary)
FROM divided_routes, named_places
WHERE divided_routes.name = 'Route 75' AND named_places.name = 'Ashton';
--
@@ -857,7 +862,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Touches(centerline, shore)
+SELECT ST_Touches(centerline, shore)
FROM streams, lakes
WHERE streams.name = 'Cam Stream' AND lakes.name = 'Blue Lake';
-- ---------------------
@@ -895,7 +900,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Within(footprint, boundary)
+SELECT ST_Within(footprint, boundary)
FROM named_places, buildings
WHERE named_places.name = 'Ashton' AND buildings.address = '215 Main Street';
-- ---------------------
@@ -931,7 +936,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Overlaps(forests.boundary, named_places.boundary)
+SELECT ST_Overlaps(forests.boundary, named_places.boundary)
FROM forests, named_places
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
-- ---------------------
@@ -969,7 +974,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Crosses(road_segments.centerline, divided_routes.centerlines)
+SELECT ST_Crosses(road_segments.centerline, divided_routes.centerlines)
FROM road_segments, divided_routes
WHERE road_segments.fid = 102 AND divided_routes.name = 'Route 75';
-- ---------------------
@@ -1005,7 +1010,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Intersects(road_segments.centerline, divided_routes.centerlines)
+SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines)
FROM road_segments, divided_routes
WHERE road_segments.fid = 102 AND divided_routes.name = 'Route 75';
-- ---------------------
@@ -1041,7 +1046,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Contains(forests.boundary, named_places.boundary)
+SELECT ST_Contains(forests.boundary, named_places.boundary)
FROM forests, named_places
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
-- ---------------------
@@ -1077,7 +1082,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
+SELECT ST_Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT')
FROM forests, named_places
WHERE forests.name = 'Green Forest' AND named_places.name = 'Ashton';
-- ---------------------
@@ -1102,7 +1107,7 @@
--
--================================
--
-SELECT Distance(position, boundary)
+SELECT ST_Distance(position, boundary)
FROM bridges, named_places
WHERE bridges.name = 'Cam Bridge' AND named_places.name = 'Ashton';
--
@@ -1139,7 +1144,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(Intersection(centerline, shore))
+SELECT ST_AsText(ST_Intersection(centerline, shore))
FROM streams, lakes
WHERE streams.name = 'Cam Stream' AND lakes.name = 'Blue Lake';
-- ---------------------
@@ -1175,7 +1180,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(Difference(named_places.boundary, forests.boundary))
+SELECT ST_AsText(ST_Difference(named_places.boundary, forests.boundary))
FROM named_places, forests
WHERE named_places.name = 'Ashton' AND forests.name = 'Green Forest';
-- ---------------------
@@ -1199,9 +1204,6 @@
-- will match the official answer.
-- Test script uses 'Ashton' as the place name where it means
-- to use 'Goose Island'.
--- Specification uses 'Union()' as a function name, but UNION
--- is a SQL reserved work. Function name adapted to 'GeomUnion()'
--- for out implementation.
-- ---------------------
-- -- BEGIN ORIGINAL SQL
-- ---------------------
@@ -1213,7 +1215,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(GeomUnion(shore, boundary))
+SELECT ST_AsText(ST_Union(shore, boundary))
FROM lakes, named_places
WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island';
-- ---------------------
@@ -1249,7 +1251,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(SymmetricDifference(shore, boundary))
+SELECT ST_AsText(ST_SymmetricDifference(shore, boundary))
FROM lakes, named_places
WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Goose Island';
-- ---------------------
@@ -1293,7 +1295,7 @@
-- ---------------------
SELECT count(*)
FROM buildings, bridges
-WHERE Contains(Buffer(bridges.position, 15.0), buildings.footprint);
+WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint);
-- ---------------------
-- -- END ADAPTED SQL
-- ---------------------
@@ -1326,7 +1328,7 @@
-- ---------------------
-- -- BEGIN ADAPTED SQL
-- ---------------------
-SELECT AsText(ConvexHull(shore))
+SELECT ST_AsText(ST_ConvexHull(shore))
FROM lakes
WHERE lakes.name = 'Blue Lake';
-- ---------------------
Modified: trunk/extras/ogc_test_suite/Makefile
===================================================================
--- trunk/extras/ogc_test_suite/Makefile 2019-02-13 22:23:14 UTC (rev 17251)
+++ trunk/extras/ogc_test_suite/Makefile 2019-02-15 18:52:38 UTC (rev 17252)
@@ -1,8 +1,8 @@
TESTDB=ogc_test_suite
all:
+ dropdb --if-exists $(TESTDB) > /dev/null
createdb $(TESTDB) > /dev/null
- createlang plpgsql $(TESTDB)
- psql $(TESTDB) < ../../postgis.sql >/dev/null 2>&1
+ psql $(TESTDB) < ../../postgis/postgis.sql >/dev/null 2>&1
psql -a -f 1_schema.sql $(TESTDB) > 1_output.txt 2>&1
psql -a -f 2_queries.sql $(TESTDB) > 2_output.txt 2>&1
@echo "---------------------------------------"
More information about the postgis-tickets
mailing list