aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-07 12:49:54 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-07 12:49:54 +0200
commitb5d3f2a250f84abb10cd9b21b5d367f1a162e50f (patch)
tree6429ba0b4c34f5aa9574bda1c44ebc040c829329 /data
parentec25bdc7b5ad3155d0078379bbca5ac9efd8280d (diff)
downloadPROJ-b5d3f2a250f84abb10cd9b21b5d367f1a162e50f.tar.gz
PROJ-b5d3f2a250f84abb10cd9b21b5d367f1a162e50f.zip
Database: more thorough consistency checks on extent of coordinate operations
Diffstat (limited to 'data')
-rw-r--r--data/sql/commit.sql8
1 files changed, 6 insertions, 2 deletions
diff --git a/data/sql/commit.sql b/data/sql/commit.sql
index 8f88abc0..9ea2935d 100644
--- a/data/sql/commit.sql
+++ b/data/sql/commit.sql
@@ -245,7 +245,9 @@ FOR EACH ROW BEGIN
cu.object_code = c.code AND
cu.extent_auth_name = ce.auth_name AND
cu.extent_code = ce.code AND
- NOT (ce.south_lat < ve.north_lat AND ve.south_lat < ce.north_lat));
+ NOT ((ce.south_lat < ve.north_lat AND ve.south_lat < ce.north_lat) OR
+ (ce.west_lon < ce.east_lon AND ve.west_lon < ve.east_lon AND
+ NOT (ce.west_lon < ve.east_lon AND ve.west_lon < ce.east_lon))) );
SELECT RAISE(ABORT, 'The area of use of at least one coordinate_operation does not intersect the one of its target CRS')
WHERE EXISTS (SELECT * FROM coordinate_operation_view v, crs_view c, usage vu, extent ve, usage cu, extent ce WHERE
v.deprecated = 0 AND
@@ -263,7 +265,9 @@ FOR EACH ROW BEGIN
cu.object_code = c.code AND
cu.extent_auth_name = ce.auth_name AND
cu.extent_code = ce.code AND
- NOT (ce.south_lat < ve.north_lat AND ve.south_lat < ce.north_lat));
+ NOT ((ce.south_lat < ve.north_lat AND ve.south_lat < ce.north_lat) OR
+ (ce.west_lon < ce.east_lon AND ve.west_lon < ve.east_lon AND
+ NOT (ce.west_lon < ve.east_lon AND ve.west_lon < ce.east_lon))) );
-- check geoid_model table
SELECT RAISE(ABORT, 'missing GEOID99 in geoid_model')