You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/sql/consistency_checks_triggers.sql
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,24 @@ FOR EACH ROW BEGIN
100
100
WHERE (SELECT dimension FROM coordinate_system WHEREcoordinate_system.auth_name=NEW.coordinate_system_auth_nameANDcoordinate_system.code=NEW.coordinate_system_code) !=1;
101
101
END;
102
102
103
+
CREATETRIGGERengineering_crs_insert_trigger
104
+
BEFORE INSERT ON engineering_crs
105
+
FOR EACH ROW BEGIN
106
+
107
+
SELECT RAISE(ABORT, 'insert on engineering_crs violates constraint: (auth_name, code) must not already exist in crs_view')
108
+
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
109
+
110
+
SELECT RAISE(ABORT, 'insert on engineering_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
111
+
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0
112
+
);
113
+
114
+
SELECT RAISE(ABORT, 'insert on engineering_crs violates constraint: datum must not be deprecated when engineering_crs is not deprecated')
115
+
WHERE EXISTS(SELECT1FROM engineering_crs datum WHEREdatum.auth_name=NEW.datum_auth_nameANDdatum.code=NEW.datum_codeANDdatum.deprecated!=0) ANDNEW.deprecated=0;
116
+
117
+
SELECT RAISE(ABORT, 'insert on engineering_crs violates constraint: coordinate_system.dimension must be 2 or 3')
118
+
WHERE (SELECT dimension FROM coordinate_system WHEREcoordinate_system.auth_name=NEW.coordinate_system_auth_nameANDcoordinate_system.code=NEW.coordinate_system_code) NOT IN (2, 3);
119
+
END;
120
+
103
121
CREATETRIGGERconversion_method_insert_trigger
104
122
BEFORE INSERT ON conversion_method
105
123
BEGIN
@@ -224,8 +242,8 @@ FOR EACH ROW BEGIN
224
242
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs(auth_name, code) not found')
225
243
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.horiz_crs_auth_nameANDcrs_view.code=NEW.horiz_crs_code);
226
244
227
-
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs must be equal to ''geographic 2D''or ''projected''')
228
-
WHERE (SELECT type FROM crs_view WHEREcrs_view.auth_name=NEW.horiz_crs_auth_nameANDcrs_view.code=NEW.horiz_crs_code) NOT IN ('geographic 2D', 'projected');
245
+
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs must be equal to ''geographic 2D'', ''projected''or ''engineering''')
246
+
WHERE (SELECT type FROM crs_view WHEREcrs_view.auth_name=NEW.horiz_crs_auth_nameANDcrs_view.code=NEW.horiz_crs_code) NOT IN ('geographic 2D', 'projected', 'engineering');
229
247
230
248
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: vertical_crs must be equal to ''vertical''')
231
249
WHERE (SELECT type FROM crs_view WHEREcrs_view.auth_name=NEW.vertical_crs_auth_nameANDcrs_view.code=NEW.vertical_crs_code) NOT IN ('vertical');
INSERT INTO"other_transformation"VALUES('PROJ','DKLAT_DEPTH_TO_DKLAT_2023_DEPTH','DKLAT depth to DKLAT(2023) depth','Accuracy 0.5 m, from datum ensemble definition','EPSG','9616','Vertical Offset','EPSG','10552','EPSG','10550',0.5,'EPSG','8603','Vertical Offset',0.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',0);
INSERT INTO"other_transformation"VALUES('EPSG','1035','Astra Minas to Campo Inchauspe / Argentina 2 (1)','Scale provided by information source as 0 ppm, corresponding to a scale factor for source CRS equal to 1 as used in this record.','EPSG','9621','Similarity transformation','EPSG','5800','EPSG','22192',5.0,'EPSG','8621','Ordinate 1 of evaluation point in target CRS',2610200.48,'EPSG','9001','EPSG','8622','Ordinate 2 of evaluation point in target CRS',4905282.73,'EPSG','9001','EPSG','1061','Scale factor for source CRS axes',1.0,'EPSG','9201','EPSG','8614','Rotation angle of source CRS axes',271.053,'EPSG','9110',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'IHS-Arg ComRiv',0);
INSERT INTO"other_transformation"VALUES('EPSG','1072','Palestine 1923 / Israeli CS to Israel 1993 / Israeli TM (1)','Accuracy: 1m to north and 10m to south of east-west line through Beersheba (31°15''N). For more accurate transformation contact Survey of Israel.','EPSG','9656','Cartesian Grid Offsets','EPSG','28193','EPSG','2039',3.0,'EPSG','8728','Easting offset',50000.0,'EPSG','9001','EPSG','8729','Northing offset',-500000.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'SoI-Isr',0);
INSERT INTO"other_transformation"VALUES('EPSG','6699','JGD2000 (vertical) height to JGD2011 (vertical) height (1)','Excludes areas of eastern Honshu affected by 2008 Iwate-Miyagi and 2011 Tohoku earthquakes (Aomori, Iwate, Miyagi, Akita, Yamagata, Fukushima and Ibaraki prefectures).','EPSG','9616','Vertical Offset','EPSG','6694','EPSG','6695',0.01,'EPSG','8603','Vertical Offset',0.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'OGP-Jpn ex E Honshu',0);
INSERT INTO"other_transformation"VALUES('EPSG','6724','CIG85 to GDA94 / MGA zone 48','Accuracy estimated as sub-metre in northeast of island and variable up to 8m in west and south.','EPSG','9656','Cartesian Grid Offsets','EPSG','6715','EPSG','28348',5.0,'EPSG','8728','Easting offset',550015.0,'EPSG','9001','EPSG','8729','Northing offset',8780001.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'GA-Cxr',0);
INSERT INTO"other_transformation"VALUES('EPSG','7008','Nahrwan 1934 / UTM zone 37N to Karbala 1979 / UTM zone 37N (1)','May be emulated using geocentric translations from Nahrwan 1934 to Karbala 1979 of dX=-346, dY=216 and dZ=156m.','EPSG','9656','Cartesian Grid Offsets','EPSG','7005','EPSG','3391',5.0,'EPSG','8728','Easting offset',386.0,'EPSG','9001','EPSG','8729','Northing offset',204.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MoO-Irq map B sheet 1',0);
INSERT INTO"other_transformation"VALUES('EPSG','7009','Nahrwan 1934 / UTM zone 38N to Karbala 1979 / UTM zone 38N (2)','May be emulated using geocentric translations from Nahrwan 1934 to Karbala 1979 of dX=-351, dY=190 and dZ=171m.','EPSG','9656','Cartesian Grid Offsets','EPSG','7006','EPSG','3392',5.0,'EPSG','8728','Easting offset',383.0,'EPSG','9001','EPSG','8729','Northing offset',205.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MoO-Irq map B sheet 2',0);
@@ -1054,6 +1058,8 @@ INSERT INTO "other_transformation" VALUES('EPSG','15696','Tokyo + JSLD height to
INSERT INTO"other_transformation"VALUES('EPSG','15747','Tombak LNG Plant Grid to Nakhl-e Ghanem / UTM zone 39N (1)','','EPSG','9621','Similarity transformation','EPSG','5817','EPSG','3307',0.0,'EPSG','8621','Ordinate 1 of evaluation point in target CRS',611267.2865,'EPSG','9001','EPSG','8622','Ordinate 2 of evaluation point in target CRS',3046565.8255,'EPSG','9001','EPSG','1061','Scale factor for source CRS axes',0.9997728332,'EPSG','9201','EPSG','8614','Rotation angle of source CRS axes',315.0,'EPSG','9102',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Tot-Irn',0);
INSERT INTO"other_transformation"VALUES('EPSG','15857','IGN Astro 1960 / UTM zone 28N to Mauritania 1999 / UTM zone 28N (1)','Parameter values consistent with the OGP Affine parametric transformation method derived by OGP from the published Helmert 2D parameter values. May be used for transformations to WGS 84 - see tfm code 15861.','EPSG','9624','Affine parametric transformation','EPSG','3367','EPSG','3343',40.0,'EPSG','8623','A0',-532.876,'EPSG','9001','EPSG','8624','A1',1.00017216658401,'EPSG','9203','EPSG','8625','A2',9.029305555e-05,'EPSG','9203','EPSG','8639','B0',-34.015,'EPSG','9001','EPSG','8640','B1',-9.029305555e-05,'EPSG','9203','EPSG','8641','B2',1.00017216658401,'EPSG','9203',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MMI-Mau W',0);
INSERT INTO"other_transformation"VALUES('EPSG','15858','IGN Astro 1960 / UTM zone 29N to Mauritania 1999 / UTM zone 29N (1)','Parameter values consistent with the OGP Affine parametric transformation method derived by OGP from the published Helmert 2D parameter values. May be used for transformations to WGS 84 - see tfm code 15862.','EPSG','9624','Affine parametric transformation','EPSG','3368','EPSG','3344',40.0,'EPSG','8623','A0',-409.264,'EPSG','9001','EPSG','8624','A1',1.00017432259949,'EPSG','9203','EPSG','8625','A2',9.14562824e-05,'EPSG','9203','EPSG','8639','B0',-88.803,'EPSG','9001','EPSG','8640','B1',-9.14562824e-05,'EPSG','9203','EPSG','8641','B2',1.00017432259949,'EPSG','9203',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MMI-Mau C',0);
0 commit comments