diff --git a/data/Makefile.am b/data/Makefile.am index 8f65ed5c0a..b9073bfc59 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -39,10 +39,11 @@ SQL_ORDERED_LIST = sql/begin.sql \ sql/deprecation.sql \ sql/esri.sql \ sql/ignf.sql \ + sql/nkg.sql \ sql/grid_alternatives.sql \ sql/grid_alternatives_generated_noaa.sql \ sql/customizations.sql \ - sql/nkg.sql \ + sql/nkg_post_customizations.sql \ sql/commit.sql EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \ diff --git a/data/sql/grid_alternatives.sql b/data/sql/grid_alternatives.sql index 35c92414a4..26630f044a 100644 --- a/data/sql/grid_alternatives.sql +++ b/data/sql/grid_alternatives.sql @@ -116,6 +116,10 @@ VALUES ('EGM08_REDNAP.txt','es_ign_egm08-rednap.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/es_ign_egm08-rednap.tif',1,1,NULL), ('EGM08_REDNAP_Canarias.txt','es_ign_egm08-rednap-canarias.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/es_ign_egm08-rednap-canarias.tif',1,1,NULL), +-- eur_nkg - Nordic Geodetic Commission +('eur_nkg_nkgrf03vel_realigned.tif','eur_nkg_nkgrf03vel_realigned.tif',NULL,'GTiff','velocity_grid',0,NULL,'https://cdn.proj.org/eur_nkg_nkgrf03vel_realigned.tif',1,1,NULL), +('eur_nkg_nkgrf17vel.tif','eur_nkg_nkgrf17vel.tif',NULL,'GTiff','velocity_grid',0,NULL,'https://cdn.proj.org/eur_nkg_nkgrf17vel.tif',1,1,NULL), + -- fi_nls - National Land Survey of Finland (MML) ('fi_nls_n43_n60.json','fi_nls_n43_n60.json',NULL,'JSON','tinshift',0,NULL,'https://cdn.proj.org/fi_nls_n43_n60.json',1,1,NULL), ('fi_nls_n60_n2000.json','fi_nls_n60_n2000.json',NULL,'JSON','tinshift',0,NULL,'https://cdn.proj.org/fi_nls_n60_n2000.json',1,1,NULL), @@ -184,6 +188,8 @@ VALUES -- Norwegian grids ('HREF2018B_NN2000_EUREF89.gtx','no_kv_HREF2018B_NN2000_EUREF89.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/no_kv_HREF2018B_NN2000_EUREF89.tif',1,1,NULL), ('href2008a.gtx','no_kv_href2008a.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/no_kv_href2008a.tif',1,1,NULL), +('no_kv_NKGETRF14_EPSG7922_2000.tif','no_kv_NKGETRF14_EPSG7922_2000.tif',NULL,'GTiff','geocentricoffset',0,NULL,'https://cdn.proj.org/no_kv_NKGETRF14_EPSG7922_2000.tif',1,1,NULL), +('no_kv_ETRS89NO_NGO48_TIN.json','no_kv_ETRS89NO_NGO48_TIN.json',NULL,'JSON','tinshift',0,NULL,'https://cdn.proj.org/no_kv_ETRS89NO_NGO48_TIN.json',1,1,NULL), -- nz_linz - New Zealand ('nzgd2kgrid0005.gsb','nz_linz_nzgd2kgrid0005.tif','nzgd2kgrid0005.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/nz_linz_nzgd2kgrid0005.tif',1,1,NULL), diff --git a/data/sql/nkg.sql b/data/sql/nkg.sql index 93d82f9748..69a00603f3 100644 --- a/data/sql/nkg.sql +++ b/data/sql/nkg.sql @@ -2,19 +2,6 @@ INSERT INTO "metadata" VALUES('NKG.SOURCE', 'https://github.com/NordicGeodesy/No INSERT INTO "metadata" VALUES('NKG.VERSION', '1.0.0'); INSERT INTO "metadata" VALUES('NKG.DATE', '2020-12-21'); --- Append NKG to authority references -UPDATE - authority_to_authority_preference -SET - allowed_authorities = allowed_authorities || ',NKG' -WHERE - source_auth_name = 'EPSG' AND target_auth_name = 'EPSG'; - -INSERT INTO "authority_to_authority_preference" - (source_auth_name,target_auth_name, allowed_authorities) -VALUES - ('NKG', 'EPSG', 'NKG,PROJ,EPSG'); - -- extent for NKG2008 transformations INSERT INTO "extent" VALUES( 'NKG','EXTENT_2008', -- extend auth+code @@ -693,7 +680,75 @@ INSERT INTO "usage" VALUES ( 'NKG', 'SCOPE_GENERIC' -- scope ); +-- NO +INSERT INTO "helmert_transformation" VALUES ( + 'NKG','PAR_2020_NO', -- operation auth+code + 'NKG_ETRF14 to ETRF93@2000.0', -- 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)', + 'NKG','ETRF14', -- source auth+code + 'EPSG','7922', -- target auth+code + 0.01, -- accuracy + -0.05172, -- x + 0.13747, -- y + -0.01648, -- z + 'EPSG','9001', + 0.00268452, -- rx + 0.00329165, -- ry + -0.00116569, -- rz + 'EPSG','9104', + 0.002583, -- s + 'EPSG','9202', + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + 'NKG 2020', -- operation version + 0 +); +INSERT INTO "usage" VALUES ( + 'NKG', '5041', -- usage auth+code + 'helmert_transformation', -- object_table_name + 'NKG','PAR_2020_NO', -- object auth+code + 'EPSG', '1352', -- extent: Norway - onshore + 'NKG', 'SCOPE_GENERIC' -- scope +); + +INSERT INTO "other_transformation" ( + auth_name, + code, + name, + description, + method_auth_name, + method_code, + method_name, + source_crs_auth_name, + source_crs_code, + target_crs_auth_name, + target_crs_code, + accuracy, + operation_version, + deprecated +) +VALUES( + 'NKG', 'NKG_ETRF14_ETRF93_2000', -- object auth+code + 'NKG_ETRF14 to ETRF93@2000.0', -- 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', + 'NKG','ETRF14', -- source auth+code + 'EPSG','7922', -- target auth+code + 0.005, -- accuracy + 'NKG 2020', -- operation_version + 0 -- deprecated +); + +INSERT INTO "usage" VALUES ( + 'NKG', '5064', + 'other_transformation', + 'NKG', 'NKG_ETRF14_ETRF93_2000', + 'EPSG', '1352', + 'NKG', 'SCOPE_GENERIC' +); -- SE INSERT INTO "helmert_transformation" VALUES ( @@ -2056,6 +2111,116 @@ INSERT INTO "supersession" VALUES ( ); +------------------------------------------------------- +-- Transformation: NKG_ETRF14 -> ETRF93@1995.0 (NO) +------------------------------------------------------- + +INSERT INTO "other_transformation" ( + auth_name, + code, + name, + description, + method_auth_name, + method_code, + method_name, + source_crs_auth_name, + source_crs_code, + target_crs_auth_name, + target_crs_code, + accuracy, + operation_version, + deprecated +) +VALUES( + 'NKG', 'NO_2020_INTRAPLATE', -- object auth+code + 'ETRF93@2000.0 to ETRF93@1995.0', -- name + NULL, -- description + 'PROJ', 'PROJString', -- method auth+cod + '+proj=deformation +dt=-5 +grids=eur_nkg_nkgrf17vel.tif', + 'EPSG','7922', -- source_crs: ETRF93@2000.0 + 'EPSG','4936', -- target_crs: ETRS89 (NO) + 0.005, -- accuracy + 'NKG 2020', -- operation_version + 0 -- deprecated +); + +INSERT INTO "usage" VALUES ( + 'NKG', '5058', -- usage auth+code + 'other_transformation', -- object_table_name + 'NKG', 'NO_2020_INTRAPLATE', -- object auth+code + 'EPSG', '1352', -- extent: Norway - onshore and offshore + 'NKG', 'SCOPE_GENERIC' -- scope +); + +INSERT INTO "concatenated_operation" VALUES( + 'NKG', 'ETRF14_TO_NO', -- operation auth+code + 'NKG_ETRF14 to ETRS89(NO)', -- name + 'Transformation from NKG_ETRF14@2000.0 to ETRF93@1995.0', -- description + 'NKG', 'ETRF14',-- source_crs: NKG_ETRF00 + 'EPSG','4936', -- target_crs: ETRS89 (NO) + 0.01, -- accuracy + 'NKG 2020', -- operation_version + 0 -- deprecated +); + +INSERT INTO "concatenated_operation_step" ( + operation_auth_name, operation_code, step_number, step_auth_name, step_code +) VALUES + ('NKG', 'ETRF14_TO_NO', 1, 'NKG', 'PAR_2020_NO'), + ('NKG', 'ETRF14_TO_NO', 2, 'NKG', 'NO_2020_INTRAPLATE') +; + +INSERT INTO "usage" VALUES ( + 'NKG', '5059', -- usage auth+code + 'concatenated_operation', -- object_table_name + 'NKG', 'ETRF14_TO_NO', -- object auth+code + 'EPSG', '1352', -- extent: Norway - onshore and offshore + 'NKG', 'SCOPE_GENERIC' -- scope auth+code +); + + +------------------------------------------------------- +-- Transformation: ITRF2014 -> ETRF93@1995.0 (NO) +------------------------------------------------------- + +INSERT INTO "concatenated_operation" VALUES ( + 'NKG', 'ITRF2014_TO_NO', -- operation auth+code + 'ITRF2014 to ETRS89(NO)', -- name + 'Time-dependent transformation from ITRF2014 to ETRS89(NO)', -- description + 'EPSG', '7789', -- source_crs: ITRF2014 + 'EPSG', '4936', -- target_crs: ETRS89(NO) + 0.01, -- accuracy + 'NKG 2020', -- operation_version + 0 -- deprecated +); + +INSERT INTO "concatenated_operation_step" ( + operation_auth_name, operation_code, step_number, step_auth_name, step_code +) VALUES + ('NKG', 'ITRF2014_TO_NO', 1, 'EPSG', '8366'), -- ITRF2014 -> ETRF2014 + ('NKG', 'ITRF2014_TO_NO', 2, 'NKG', 'NKG_ETRF14_TO_ETRF2014'), + ('NKG', 'ITRF2014_TO_NO', 3, 'NKG', 'NKG_ETRF14_ETRF93_2000'), + ('NKG', 'ITRF2014_TO_NO', 4, 'NKG', 'NO_2020_INTRAPLATE') +; + +INSERT INTO "usage" VALUES ( + 'NKG', '5060', -- usage auth+code + 'concatenated_operation', -- object_table_name + 'NKG', 'ITRF2014_TO_NO', -- object auth+code + 'EPSG', '1352', -- extent: Norway - onshore and offshore + 'NKG', 'SCOPE_GENERIC' -- scope auth+code +); + +INSERT INTO "supersession" VALUES ( + 'concatenated_operation', + 'NKG', 'ITRF2000_TO_NO', + 'concatenated_operation', + 'NKG', 'ITRF2014_TO_NO', + 'NKG', + 0 +); + + ------------------------------------------------------- -- Transformation: NKG_ETRF14 -> ETRF97@1999.5 (SE) ------------------------------------------------------- diff --git a/data/sql/nkg_post_customizations.sql b/data/sql/nkg_post_customizations.sql new file mode 100644 index 0000000000..68bf0dbf72 --- /dev/null +++ b/data/sql/nkg_post_customizations.sql @@ -0,0 +1,13 @@ + +-- Append NKG to authority references +UPDATE + authority_to_authority_preference +SET + allowed_authorities = allowed_authorities || ',NKG' +WHERE + source_auth_name = 'EPSG' AND target_auth_name = 'EPSG'; + +INSERT INTO "authority_to_authority_preference" + (source_auth_name,target_auth_name, allowed_authorities) +VALUES + ('NKG', 'EPSG', 'NKG,PROJ,EPSG'); diff --git a/data/sql/other_transformation_custom.sql b/data/sql/other_transformation_custom.sql index c0c2bf1119..311db23571 100644 --- a/data/sql/other_transformation_custom.sql +++ b/data/sql/other_transformation_custom.sql @@ -1,5 +1,21 @@ -- This file is hand generated. +-- Norway triangulated files + +INSERT INTO other_transformation VALUES( + 'PROJ','NGO48_TO_ETRS89NO','NGO 1948 to ETRS89 (2)', + 'Transformation based on a triangulated irregular network', + 'PROJ','PROJString', + '+proj=pipeline ' || + '+step +proj=axisswap +order=2,1 ' || + '+step +proj=tinshift +file=no_kv_ETRS89NO_NGO48_TIN.json +inv ' || + '+step +proj=axisswap +order=2,1', + 'EPSG','4273', + 'EPSG','4258', + 0.1, + 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,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO "usage" VALUES('PROJ','NGO48_TO_ETRS89NO_USAGE','other_transformation','PROJ','NGO48_TO_ETRS89NO','EPSG','1352','EPSG','1031'); + -- Finland triangulated files INSERT INTO other_transformation VALUES( diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql index b879cab8d9..037e2b6dd7 100644 --- a/data/sql/proj_db_table_defs.sql +++ b/data/sql/proj_db_table_defs.sql @@ -1089,7 +1089,7 @@ CREATE TABLE grid_alternatives( proj_grid_name TEXT NOT NULL, -- PROJ >= 7 grid name (e.g us_nga_egm08_25.tif) old_proj_grid_name TEXT, -- PROJ < 7 grid name (e.g egm08_25.gtx) proj_grid_format TEXT NOT NULL, -- 'GTiff', 'GTX', 'NTv2', JSON - proj_method TEXT NOT NULL, -- hgridshift, vgridshift, geoid_like, geocentricoffset or tinshift + proj_method TEXT NOT NULL, -- hgridshift, vgridshift, geoid_like, geocentricoffset, tinshift or velocity_grid inverse_direction BOOLEAN NOT NULL CHECK (inverse_direction IN (0, 1)), -- whether the PROJ grid direction is reversed w.r.t to the authority one (TRUE in that case) package_name TEXT, -- no longer used. Must be NULL url TEXT, -- optional URL where to download the PROJ grid @@ -1099,7 +1099,7 @@ CREATE TABLE grid_alternatives( CONSTRAINT fk_grid_alternatives_grid_packages FOREIGN KEY (package_name) REFERENCES grid_packages(package_name), CONSTRAINT check_grid_alternatives_grid_fromat CHECK (proj_grid_format IN ('GTiff', 'GTX', 'NTv2', 'JSON')), - CONSTRAINT check_grid_alternatives_proj_method CHECK (proj_method IN ('hgridshift', 'vgridshift', 'geoid_like', 'geocentricoffset', 'tinshift')), + CONSTRAINT check_grid_alternatives_proj_method CHECK (proj_method IN ('hgridshift', 'vgridshift', 'geoid_like', 'geocentricoffset', 'tinshift', 'velocity_grid')), CONSTRAINT check_grid_alternatives_inverse_direction CHECK (NOT(proj_method = 'geoid_like' AND inverse_direction = 1)), CONSTRAINT check_grid_alternatives_package_name CHECK (package_name IS NULL), CONSTRAINT check_grid_alternatives_direct_download_url CHECK (NOT(direct_download IS NULL AND url IS NOT NULL)), diff --git a/data/sql_filelist.cmake b/data/sql_filelist.cmake index e7bca4ffbe..2103e19ee8 100644 --- a/data/sql_filelist.cmake +++ b/data/sql_filelist.cmake @@ -32,9 +32,10 @@ set(SQL_FILES "${SQL_DIR}/deprecation.sql" "${SQL_DIR}/esri.sql" "${SQL_DIR}/ignf.sql" + "${SQL_DIR}/nkg.sql" "${SQL_DIR}/grid_alternatives.sql" "${SQL_DIR}/grid_alternatives_generated_noaa.sql" "${SQL_DIR}/customizations.sql" - "${SQL_DIR}/nkg.sql" + "${SQL_DIR}/nkg_post_customizations.sql" "${SQL_DIR}/commit.sql" ) diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo index e11989cdf8..1e964a5b90 100755 --- a/test/cli/testprojinfo +++ b/test/cli/testprojinfo @@ -275,6 +275,10 @@ echo 'Testing -s "ETRS89 / TM35FIN(E,N) + N2000 height" -t "KKJ / Finland Unifor $EXE -s "ETRS89 / TM35FIN(E,N) + N2000 height" -t "KKJ / Finland Uniform Coordinate System + N43 height" --grid-check none -o PROJ -q >>${OUT} 2>&1 echo "" >>${OUT} +# Quick check of NKG transformations +echo 'Testing NKG: -s EPSG:7789 -t EPSG:4936 --area EPSG:1080 --summary --hide-ballpark' >> ${OUT} +$EXE -s EPSG:7789 -t EPSG:4936 --area EPSG:1080 --summary --hide-ballpark >>${OUT} 2>&1 +echo "" >>${OUT} # do 'diff' with distribution results echo "diff ${OUT} with testprojinfo_out.dist" diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist index dc5c5e9e7d..cc82c1163e 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1525,3 +1525,8 @@ Testing -s "ETRS89 / TM35FIN(E,N) + N2000 height" -t "KKJ / Finland Uniform Coor +step +inv +proj=tinshift +file=fi_nls_n43_n60.json +step +proj=axisswap +order=2,1 +Testing NKG: -s EPSG:7789 -t EPSG:4936 --area EPSG:1080 --summary --hide-ballpark +Candidate operations found: 1 +Note: using '--spatial-test intersects' would bring more results (2) +NKG:ITRF2014_TO_DK, ITRF2014 to ETRS89(DK), 0.01 m, Denmark - onshore and offshore. + diff --git a/test/gie/nkg.gie b/test/gie/nkg.gie index 7414914ea3..c4efcf753d 100644 --- a/test/gie/nkg.gie +++ b/test/gie/nkg.gie @@ -201,6 +201,23 @@ tolerance 1 mm accept 3541657.3778 948984.2343 5201383.5231 2020.5 expect 3541657.3671 948984.2412 5201383.5058 2020.5 +# 2020 Transformations + +operation operation urn:ogc:def:coordinateOperation:NKG::ITRF2014_TO_NO +tolerance 0.1 mm + +# STAS +accept 3275753.4135 321111.2481 5445042.2134 2020.0 +expect 3275753.9111 321110.8658 5445041.8822 2020.0 + +# BOD3 +accept 2391773.9918 615615.1837 5860966.1279 2020.0 +expect 2391774.5535 615614.9100 5860965.8138 2020.0 + +# KAUS +accept 2107888.9134 895603.4769 5933242.6269 2020.0 +expect 2107889.5097 895603.2085 5933242.3152 2020.0 + # ------------------------------------------------------------------------------- # SWEDEN