From e10a849cd01c5b15e3123da1f6df845006322843 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 11 Mar 2021 16:12:30 +0100 Subject: [PATCH] Database: fix NKG transformations --- data/Makefile.am | 1 + data/sql/nkg.sql | 13 ------------- data/sql/nkg_post_customizations.sql | 13 +++++++++++++ data/sql_filelist.cmake | 3 ++- test/cli/testprojinfo | 4 ++++ test/cli/testprojinfo_out.dist | 5 +++++ 6 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 data/sql/nkg_post_customizations.sql diff --git a/data/Makefile.am b/data/Makefile.am index 762f902d13..b9073bfc59 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -43,6 +43,7 @@ SQL_ORDERED_LIST = sql/begin.sql \ sql/grid_alternatives.sql \ sql/grid_alternatives_generated_noaa.sql \ sql/customizations.sql \ + sql/nkg_post_customizations.sql \ sql/commit.sql EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \ diff --git a/data/sql/nkg.sql b/data/sql/nkg.sql index 56b4620697..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 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_filelist.cmake b/data/sql_filelist.cmake index b683a89212..2103e19ee8 100644 --- a/data/sql_filelist.cmake +++ b/data/sql_filelist.cmake @@ -35,6 +35,7 @@ set(SQL_FILES "${SQL_DIR}/nkg.sql" "${SQL_DIR}/grid_alternatives.sql" "${SQL_DIR}/grid_alternatives_generated_noaa.sql" - "${SQL_DIR}/customizations.sql" + "${SQL_DIR}/customizations.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 42d1096ac2..920374d947 100644 --- a/test/cli/testprojinfo_out.dist +++ b/test/cli/testprojinfo_out.dist @@ -1521,3 +1521,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. +