Skip to content

Commit

Permalink
Make NKG Transformation names unique
Browse files Browse the repository at this point in the history
A consequence of new database constrains introduced in OSGeo#4071.
  • Loading branch information
kbevers committed Mar 21, 2024
1 parent a3110b7 commit d1f9f7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
36 changes: 18 additions & 18 deletions data/sql/nkg.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INSERT INTO "metadata" VALUES('NKG.SOURCE', '/~https://github.com/NordicGeodesy/NordicTransformations');
INSERT INTO "metadata" VALUES('NKG.VERSION', '1.0.0');
INSERT INTO "metadata" VALUES('NKG.DATE', '2020-12-21');
INSERT INTO "metadata" VALUES('NKG.VERSION', '1.0.1');
INSERT INTO "metadata" VALUES('NKG.DATE', '2024-03-21');

-- extent for NKG2008 transformations
INSERT INTO "extent" VALUES(
Expand Down Expand Up @@ -687,7 +687,7 @@ INSERT INTO "usage" VALUES (
-- NO
INSERT INTO "helmert_transformation" VALUES (
'NKG','PAR_2020_NO', -- operation auth+code
'NKG_ETRF14 to ETRF93@2000.0', -- name
'NKG_ETRF14 to ETRF93@2000.0 (Helmert)', -- name
'Transformation from NKG_ETRF14 to ETRF93, at transformation reference epoch 2000.0', -- description / remark
'EPSG','1033', -- method auth+code
'Position Vector transformation (geocentric domain)',
Expand Down Expand Up @@ -735,7 +735,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'NKG_ETRF14_ETRF93_2000', -- object auth+code
'NKG_ETRF14 to ETRF93@2000.0', -- name
'NKG_ETRF14 to ETRF93@2000.0 (Gridshift)', -- name
'Transformation from NKG_ETRF14 to ETRF93, at transformation reference epoch 2000.0', -- description / remark
'PROJ', 'PROJString',
'+proj=xyzgridshift +grids=no_kv_NKGETRF14_EPSG7922_2000.tif',
Expand Down Expand Up @@ -812,7 +812,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF92_2000_TO_ETRF92_1994',-- object auth+code
'ETRF92@2000.0 to ETRF92@1994.704', -- name
'Intraplate deformation from ETRF92@2000.0 to ETRF92@1994.704 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-5.296 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -917,7 +917,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF96_2000_TO_ETRF96_1997_56',-- object auth+code
'ETRF96@2000.0 to ETRF96@1997.56', -- name
'Intraplate deformation from ETRF96@2000.0 to ETRF96@1997.56 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-2.44 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1025,7 +1025,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF96_2000_TO_ETRF96_1997',-- object auth+code
'ETRF96@2000.0 to ETRF96@1997.0', -- name
'Intraplate deformation from ETRF96@2000.0 to ETRF96@1997.0 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-3.0 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1133,7 +1133,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF89_2000_TO_ETRF89_1992',-- object auth+code
'ETRF89@2000.0 to ETRF89@1992.75', -- name
'Intraplate deformation from ETRF89@2000.0 to ETRF89@1992.75 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-7.25 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1240,7 +1240,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF2000_2000_TO_ETRF_2000_2003',-- object auth+code
'ETRF2000@2000.0 to ETRF2000@2003.75', -- name
'Intraplate deformation from ETRF2000@2000.0 to ETRF2000@2003.75 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=3.75 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1347,7 +1347,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF93_2000_TO_ETRF93_1995',-- object auth+code
'ETRF93@2000.0 to ETRF93@1995.0', -- name
'Intraplate deformation from ETRF93@2000.0 to ETRF93@1995.0 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-5 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1454,7 +1454,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'ETRF97_2000_TO_ETRF97_1999',-- object auth+code
'ETRF97@2000.0 to ETRF97@1999.5', -- name
'Intraplate deformation from ETRF97@2000.0 to ETRF97@1999.5 using realigned nkgrf03vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-0.5 +grids=eur_nkg_nkgrf03vel_realigned.tif',
Expand Down Expand Up @@ -1559,7 +1559,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'DK_2020_INTRAPLATE', -- object auth+code
'ETRF92@2000.0 to ETRF92@1994.704', -- name
'Intraplate deformation from ETRF92@2000.0 to ETRF92@1994.704 using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=15.829 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -1673,7 +1673,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'EE_2020_INTRAPLATE',-- object auth+code
'ETRF96@2000.0 to ETRF96@1997.56', -- name
'Intraplate deformation from ETRF96@2000.0 to ETRF96@1997.56 using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-2.44 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -1789,7 +1789,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'FI_2020_INTRAPLATE',-- object auth+code
'ETRF96@2000.0 to ETRF96@1997.0', -- name
'Intraplate deformation from ETRF96@2000.0 to ETRF96@1997.0 using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-3 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -1905,7 +1905,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'LV_2020_INTRAPLATE', -- object auth+code
'ETRF89@2000.0 to ETRF89@1992.75 (LKS-92)', -- name
'Intraplate deformation from ETRF89@2000.0 to ETRF89@1992.75 (LKS-92) using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-7.25 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -2021,7 +2021,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'LT_2020_INTRAPLATE', -- object auth+code
'ETRF2000@2000.0 to ETRF2000@2003.75 (LKS94)', -- name
'Intraplate deformation from ETRF2000@2000.0 to ETRF2000@2003.75 (LKS94) using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=3.75 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -2137,7 +2137,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'NO_2020_INTRAPLATE', -- object auth+code
'ETRF93@2000.0 to ETRF93@1995.0', -- name
'Intraplate deformation from ETRF93@2000.0 to ETRF93@1995.0 using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-5 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down Expand Up @@ -2247,7 +2247,7 @@ INSERT INTO "other_transformation" (
)
VALUES(
'NKG', 'SE_2020_INTRAPLATE',-- object auth+code
'ETRF97@2000.0 to ETRF97@1999.5', -- name
'Intraplate deformation from ETRF97@2000.0 to ETRF97@1999.5 using nkgrf17vel deformation model', -- name
NULL, -- description
'PROJ', 'PROJString', -- method auth+cod
'+proj=deformation +dt=-0.5 +grids=eur_nkg_nkgrf17vel.tif',
Expand Down
6 changes: 0 additions & 6 deletions data/sql/proj_db_table_defs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1314,12 +1314,6 @@ FOR EACH ROW BEGIN
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')
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.name = NEW.name AND covwv.deprecated = 0 AND NEW.deprecated = 0
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
AND NEW.name != 'NKG_ETRF14 to ETRF93@2000.0' -- NKG:PAR_2020_NO and NKG:NKG_ETRF14_ETRF93_2000 have the same name
AND NEW.name != 'ETRF96@2000.0 to ETRF96@1997.56' -- NKG:ETRF96_2000_TO_ETRF96_1997_56 and NKG:EE_2020_INTRAPLATE have the same name
AND NEW.name != 'ETRF93@2000.0 to ETRF93@1995.0' -- NKG:ETRF93_2000_TO_ETRF93_1995 and NKG:NO_2020_INTRAPLATE have the same name
AND NEW.name != 'ETRF92@2000.0 to ETRF92@1994.704' -- NKG:ETRF92_2000_TO_ETRF92_1994 and NKG:DK_2020_INTRAPLATE have the same name
AND NEW.name != 'ETRF96@2000.0 to ETRF96@1997.0' -- NKG:ETRF96_2000_TO_ETRF96_1997 AND NKG:FI_2020_INTRAPLATE have the same name
AND NEW.name != 'ETRF97@2000.0 to ETRF97@1999.5' -- NKG:ETRF97_2000_TO_ETRF97_1999 and NKG:SE_2020_INTRAPLATE have the same name
);

SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: source_crs(auth_name, code) not found')
Expand Down

0 comments on commit d1f9f7c

Please sign in to comment.