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
CREATETABLEbuiltin_authorities(auth_name TEXTNOT NULLPRIMARY KEY) WITHOUT ROWID;
312
+
INSERT INTO builtin_authorities VALUES
313
+
('EPSG'),
314
+
('ESRI'),
315
+
('IAU_2015'),
316
+
('IGNF'),
317
+
('NKG'),
318
+
('NRCAN'),
319
+
('OGC'),
320
+
('PROJ')
321
+
;
322
+
309
323
CREATETRIGGERvertical_crs_insert_trigger
310
324
BEFORE INSERT ON vertical_crs
311
325
FOR EACH ROW BEGIN
@@ -314,7 +328,8 @@ FOR EACH ROW BEGIN
314
328
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
315
329
316
330
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
317
-
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF'
331
+
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0
332
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
318
333
AND NOT(NEW.auth_name='ESRI'andcrs_view.table_name='geodetic_crs') -- some ESRI vertical CRS are an ellipsoidal height CRS derived from a geodetic CRS
319
334
);
320
335
@@ -729,7 +744,9 @@ FOR EACH ROW BEGIN
729
744
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
730
745
731
746
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
732
-
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF'ANDNEW.name!='unknown');
747
+
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0
748
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
749
+
);
733
750
734
751
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: geodetic_crs must not be deprecated when projected_crs is not deprecated')
735
752
WHERE EXISTS(SELECT1FROM geodetic_crs WHEREgeodetic_crs.auth_name=NEW.geodetic_crs_auth_nameANDgeodetic_crs.code=NEW.geodetic_crs_codeANDgeodetic_crs.deprecated!=0ANDgeodetic_crs.name NOT LIKE'Unknown datum%'ANDgeodetic_crs.name NOT LIKE'Unspecified datum%') ANDNEW.deprecated=0AND NOT (NEW.auth_name='ESRI'ANDNEW.geodetic_crs_auth_name!='ESRI');
@@ -773,7 +790,9 @@ FOR EACH ROW BEGIN
773
790
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
774
791
775
792
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
776
-
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF');
793
+
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.name=NEW.nameANDcrs_view.deprecated=0ANDNEW.deprecated=0
794
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
795
+
);
777
796
778
797
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs(auth_name, code) not found')
779
798
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.horiz_crs_auth_nameANDcrs_view.code=NEW.horiz_crs_code);
@@ -1038,7 +1057,8 @@ FOR EACH ROW BEGIN
1038
1057
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1039
1058
1040
1059
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1041
-
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF'
1060
+
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0
1061
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
1042
1062
ANDNEW.name!='NKG_ETRF00 to [email protected]'-- NKG:P1_2008_EE and NKG:P1_2008_FI have the same name
1043
1063
ANDNEW.name!='NKG_ETRF14 to [email protected]'-- NKG:PAR_2020_EE and NKG:PAR_2020_FI have the same name
1044
1064
);
@@ -1114,7 +1134,8 @@ FOR EACH ROW BEGIN
1114
1134
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1115
1135
1116
1136
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1117
-
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF'
1137
+
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0
1138
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
1118
1139
ANDNEW.name!='NAD83(CSRS)v2 to NAD83(CSRS)v3 (1)'-- duplicate entry in EPSG
1119
1140
ANDNEW.name!='ETRS89 to ETRS89 + Baltic 1957 height (1)'-- duplicate entry in EPSG
1120
1141
AND NOT (NEW.descriptionLIKE'Reversible alternative to%'ANDcovwv.description NOT LIKE'Reversible alternative to%')
@@ -1292,7 +1313,8 @@ FOR EACH ROW BEGIN
1292
1313
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1293
1314
1294
1315
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1295
-
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0ANDNEW.auth_name!='IGNF'
1316
+
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0
1317
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
1296
1318
ANDNEW.name!='NKG_ETRF14 to [email protected]'-- NKG:PAR_2020_NO and NKG:NKG_ETRF14_ETRF93_2000 have the same name
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1348
1370
1349
1371
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1350
-
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0ANDnew.auth_name!='IGNF');
1372
+
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.name=NEW.nameANDcovwv.deprecated=0ANDNEW.deprecated=0
1373
+
ANDNEW.auth_nameIN (SELECT auth_name FROM builtin_authorities WHERE auth_name !='IGNF')
1374
+
);
1351
1375
1352
1376
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: source_crs(auth_name, code) not found')
1353
1377
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.source_crs_auth_nameANDcrs_view.code=NEW.source_crs_code);
0 commit comments