aboutsummaryrefslogtreecommitdiff
path: root/data/sql/commit.sql
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-01 22:26:12 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-01 22:26:12 +0200
commitdbf47894146e9206699dbb76739729482466aa5d (patch)
tree5af33178a40d68084fbdfb47d3e6af02367c9f0b /data/sql/commit.sql
parenta028ecd97b15c4afeab2016ed507f2d4be842722 (diff)
downloadPROJ-dbf47894146e9206699dbb76739729482466aa5d.tar.gz
PROJ-dbf47894146e9206699dbb76739729482466aa5d.zip
Database: add extra check for 'Vertical Offset by Grid Interpolation' transformations
Diffstat (limited to 'data/sql/commit.sql')
-rw-r--r--data/sql/commit.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/data/sql/commit.sql b/data/sql/commit.sql
index 8f647530..53aea887 100644
--- a/data/sql/commit.sql
+++ b/data/sql/commit.sql
@@ -122,6 +122,18 @@ FOR EACH ROW BEGIN
(SELECT auth_name || code FROM geodetic_crs
WHERE type = 'geographic 3D'));
+ -- check that grids with 'Vertical Offset by Grid Interpolation' methods are properly registered
+ SELECT RAISE(ABORT, 'One grid_transformation with Vertical Offset by Grid Interpolation has not its source_crs in vertical_crs table')
+ WHERE EXISTS (SELECT * FROM grid_transformation g WHERE
+ g.method_name LIKE 'Vertical Offset by Grid Interpolation%' AND
+ g.source_crs_auth_name || g.source_crs_code NOT IN
+ (SELECT auth_name || code FROM vertical_crs));
+ SELECT RAISE(ABORT, 'One grid_transformation with Vertical Offset by Grid Interpolation has not its target_crs in vertical_crs table')
+ WHERE EXISTS (SELECT * FROM grid_transformation g WHERE
+ g.method_name LIKE 'Vertical Offset by Grid Interpolation%' AND
+ g.target_crs_auth_name || g.target_crs_code NOT IN
+ (SELECT auth_name || code FROM vertical_crs));
+
-- check that transformations intersect the area of use of their source/target CRS
-- EPSG, ESRI and IGNF have cases where this does not hold.
SELECT RAISE(ABORT, 'The area of use of at least one coordinate_operation does not intersect the one of its source CRS')