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
312
326
313
327
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: (auth_name, code) must not already exist in crs_view')
314
328
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
315
329
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')
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')
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
334
+
);
335
+
316
336
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: datum must not be deprecated when vertical_crs is not deprecated')
317
337
WHERE EXISTS(SELECT1FROM vertical_crs datum WHEREdatum.auth_name=NEW.datum_auth_nameANDdatum.code=NEW.datum_codeANDdatum.deprecated!=0) ANDNEW.deprecated=0;
318
338
@@ -723,6 +743,11 @@ FOR EACH ROW BEGIN
723
743
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: (auth_name, code) must not already exist in crs_view')
724
744
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
725
745
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')
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
+
);
750
+
726
751
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: geodetic_crs must not be deprecated when projected_crs is not deprecated')
727
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');
728
753
@@ -764,6 +789,11 @@ FOR EACH ROW BEGIN
764
789
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: (auth_name, code) must not already exist in crs_view')
765
790
WHERE EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.auth_nameANDcrs_view.code=NEW.code);
766
791
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')
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
+
);
796
+
767
797
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs(auth_name, code) not found')
768
798
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.horiz_crs_auth_nameANDcrs_view.code=NEW.horiz_crs_code);
769
799
@@ -1026,6 +1056,13 @@ FOR EACH ROW BEGIN
1026
1056
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
1027
1057
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1028
1058
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')
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')
1062
+
ANDNEW.name!='NKG_ETRF00 to [email protected]'-- NKG:P1_2008_EE and NKG:P1_2008_FI have the same name
1063
+
ANDNEW.name!='NKG_ETRF14 to [email protected]'-- NKG:PAR_2020_EE and NKG:PAR_2020_FI have the same name
1064
+
);
1065
+
1029
1066
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: translation_uom.type must be ''length''')
1030
1067
WHERE (SELECT type FROM unit_of_measure WHEREunit_of_measure.auth_name=NEW.translation_uom_auth_nameANDunit_of_measure.code=NEW.translation_uom_code) !='length';
1031
1068
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: rotation_uom.type must be ''angle''')
@@ -1096,6 +1133,15 @@ FOR EACH ROW BEGIN
1096
1133
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
1097
1134
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1098
1135
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')
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')
1139
+
ANDNEW.name!='NAD83(CSRS)v2 to NAD83(CSRS)v3 (1)'-- duplicate entry in EPSG
1140
+
ANDNEW.name!='ETRS89 to ETRS89 + Baltic 1957 height (1)'-- duplicate entry in EPSG
1141
+
AND NOT (NEW.descriptionLIKE'Reversible alternative to%'ANDcovwv.description NOT LIKE'Reversible alternative to%')
1142
+
ANDNEW.code NOT LIKE'%_WITH_NAD83CSRSV7_INTERPOLATION'
1143
+
);
1144
+
1099
1145
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: source_crs(auth_name, code) not found')
1100
1146
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.source_crs_auth_nameANDcrs_view.code=NEW.source_crs_code);
1101
1147
@@ -1266,6 +1312,17 @@ FOR EACH ROW BEGIN
1266
1312
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
1267
1313
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1268
1314
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')
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')
1318
+
ANDNEW.name!='NKG_ETRF14 to [email protected]'-- NKG:PAR_2020_NO and NKG:NKG_ETRF14_ETRF93_2000 have the same name
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: source_crs(auth_name, code) not found')
1270
1327
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.source_crs_auth_nameANDcrs_view.code=NEW.source_crs_code);
1271
1328
@@ -1311,6 +1368,11 @@ FOR EACH ROW BEGIN
1311
1368
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
1312
1369
WHERE EXISTS (SELECT1FROM coordinate_operation_with_conversion_view covwv WHEREcovwv.auth_name=NEW.auth_nameANDcovwv.code=NEW.code);
1313
1370
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')
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
+
);
1375
+
1314
1376
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: source_crs(auth_name, code) not found')
1315
1377
WHERE NOT EXISTS (SELECT1FROM crs_view WHEREcrs_view.auth_name=NEW.source_crs_auth_nameANDcrs_view.code=NEW.source_crs_code);
1316
1378
@@ -1469,8 +1531,8 @@ CREATE VIEW coordinate_operation_view AS
0 commit comments