aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-30 11:33:59 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-03-30 12:57:03 +0200
commitda32ee9459cb08df87d5c02a83037158772d1047 (patch)
treeceec9020c8e62af775168b62d2b89dd7c75f14e8
parent64946ab103d66508bf56bf80417bb5d69876bd25 (diff)
downloadPROJ-da32ee9459cb08df87d5c02a83037158772d1047.tar.gz
PROJ-da32ee9459cb08df87d5c02a83037158772d1047.zip
Database: fix registration of custom entries of grid_transformation_custom.sql for geoid grids (fixes #2112)
-rw-r--r--data/sql/commit.sql13
-rw-r--r--data/sql/grid_transformation_custom.sql56
-rw-r--r--test/cli/testprojinfo_out.dist14
3 files changed, 35 insertions, 48 deletions
diff --git a/data/sql/commit.sql b/data/sql/commit.sql
index a3028586..d090ccb2 100644
--- a/data/sql/commit.sql
+++ b/data/sql/commit.sql
@@ -63,19 +63,6 @@ FOR EACH ROW BEGIN
(SELECT auth_name || code FROM geodetic_crs
WHERE type = 'geographic 2D'));
- -- check that grids with HEIGHT_TO_GEOGRAPHIC3D method are properly registered
- SELECT RAISE(ABORT, 'One grid_transformation with HEIGHT_TO_GEOGRAPHIC3D has not its source_crs in vertical_crs table')
- WHERE EXISTS (SELECT * FROM grid_transformation g WHERE
- g.method_code = 'HEIGHT_TO_GEOGRAPHIC3D' AND
- g.source_crs_auth_name || g.source_crs_code NOT IN
- (SELECT auth_name || code FROM vertical_crs));
- SELECT RAISE(ABORT, 'One grid_transformation with HEIGHT_TO_GEOGRAPHIC3D has not its target_crs in geodetic_crs table with type = ''geographic 3D''')
- WHERE EXISTS (SELECT * FROM grid_transformation g WHERE
- g.method_code = 'HEIGHT_TO_GEOGRAPHIC3D' AND
- g.target_crs_auth_name || g.target_crs_code NOT IN
- (SELECT auth_name || code FROM geodetic_crs
- WHERE type = 'geographic 3D'));
-
-- check that grids with Geographic3D to GravityRelatedHeight method are properly registered
SELECT RAISE(ABORT, 'One grid_transformation with Geographic3D to GravityRelatedHeight has not its target_crs in vertical_crs table')
WHERE EXISTS (SELECT * FROM grid_transformation g WHERE
diff --git a/data/sql/grid_transformation_custom.sql b/data/sql/grid_transformation_custom.sql
index 97d36171..2de21f64 100644
--- a/data/sql/grid_transformation_custom.sql
+++ b/data/sql/grid_transformation_custom.sql
@@ -3,22 +3,22 @@
-- Denmark
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_5799_TO_EPSG_4937','DVR90 height to ETRS89',
+ 'PROJ','EPSG_4937_TO_EPSG_5799','ETRS89 to DVR90 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','5799', -- source CRS (DVR90 height)
- 'EPSG','4937', -- target CRS (ETRS89)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','4937', -- source CRS (ETRS89)
+ 'EPSG','5799', -- target CRS (DVR90 height)
'EPSG','3237', -- area of use: Denmark onshore
NULL,
'EPSG','8666','Geoid (height correction) model file','dvr90.gtx',
NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_5733_TO_EPSG_4937','DNN height to ETRS89',
+ 'PROJ','EPSG_4937_TO_EPSG_5733','ETRS89 to DNN height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','5733', -- source CRS (DNN height)
- 'EPSG','4937', -- target CRS (ETRS89)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','4937', -- source CRS (ETRS89)
+ 'EPSG','5733', -- target CRS (DNN height)
'EPSG','3237', -- area of use: Denmark onshore
NULL,
'EPSG','8666','Geoid (height correction) model file','dnn.gtx',
@@ -27,11 +27,11 @@ INSERT INTO "grid_transformation" VALUES(
-- Faroe Islands
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_5317_TO_EPSG_4937','FVR09 height to ETRS89',
+ 'PROJ','EPSG_4937_TO_EPSG_5317','ETRS89 to FVR09 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','5317', -- source CRS (FVR09 height)
- 'EPSG','4937', -- target CRS (ETRS89)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','4937', -- source CRS (ETRS89)
+ 'EPSG','5317', -- target CRS (FVR09 height)
'EPSG','3248', -- area of use: Faroe Islands - onshore
NULL,
'EPSG','8666','Geoid (height correction) model file','fvr09.gtx',
@@ -40,11 +40,11 @@ INSERT INTO "grid_transformation" VALUES(
-- Sweden
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_5613_TO_EPSG_4977','RH2000 height to SWEREF99',
+ 'PROJ','EPSG_4977_TO_EPSG_5613','SWEREF99 to RH2000 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','5613', -- source CRS (RH2000 height)
- 'EPSG','4977', -- target CRS (SWEREF99)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','4977', -- source CRS (SWEREF99)
+ 'EPSG','5613', -- target CRS (RH2000 height)
'EPSG','3313', -- area of use: Sweden onshore
NULL,
'EPSG','8666','Geoid (height correction) model file','SWEN17_RH2000.gtx',
@@ -59,33 +59,33 @@ INSERT INTO "grid_transformation" VALUES('PROJ','SETA2016','DHDN to ETRS89 (SETA
-- Iceland
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_8089_TO_EPSG_5323','ISH2004 height to ISN2004',
+ 'PROJ','EPSG_5323_TO_EPSG_8089','ISN2004 to ISH2004 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','8089', -- source CRS (ISH2004 height)
- 'EPSG','5323', -- target CRS (ISN2004 geographic 3D)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','5323', -- source CRS (ISN2004 geographic 3D)
+ 'EPSG','8089', -- target CRS (ISH2004 height)
'EPSG','1120', -- area of use: Iceland - onshore and offshore
NULL,
'EPSG','8666','Geoid (height correction) model file','Icegeoid_ISN2004.gtx',
NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_8089_TO_EPSG_4945','ISH2004 height to ISN93',
+ 'PROJ','EPSG_4945_TO_EPSG_8089','ISN93 to ISH2004 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','8089', -- source CRS (ISH2004 height)
- 'EPSG','4945', -- target CRS (ISN93 geographic 3D)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','4945', -- source CRS (ISN93 geographic 3D)
+ 'EPSG','8089', -- target CRS (ISH2004 height)
'EPSG','1120', -- area of use: Iceland - onshore and offshore
NULL,
'EPSG','8666','Geoid (height correction) model file','Icegeoid_ISN93.gtx',
NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
INSERT INTO "grid_transformation" VALUES(
- 'PROJ','EPSG_8089_TO_EPSG_8085','ISH2004 height to ISN2016',
+ 'PROJ','EPSG_8085_TO_EPSG_8089','ISN2016 to ISH2004 height',
NULL,NULL,
- 'PROJ','HEIGHT_TO_GEOGRAPHIC3D','GravityRelatedHeight to Geographic3D',
- 'EPSG','8089', -- source CRS (ISH2004 height)
- 'EPSG','8085', -- target CRS (ISN2016 geographic 3D)
+ 'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
+ 'EPSG','8085', -- source CRS (ISN2016 geographic 3D)
+ 'EPSG','8089', -- target CRS (ISH2004 height)
'EPSG','1120', -- area of use: Iceland - onshore and offshore
NULL,
'EPSG','8666','Geoid (height correction) model file','Icegeoid_ISN2016.gtx',
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index 600d1ace..99fae293 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -901,13 +901,13 @@ Candidate operations found: 1
-------------------------------------
Operation No. 1:
-PROJ:EPSG_5613_TO_EPSG_4977, RH2000 height to SWEREF99, unknown accuracy, Sweden - onshore
+INVERSE(DERIVED_FROM(PROJ)):EPSG_4977_TO_EPSG_5613, Inverse of SWEREF99 to RH2000 height, unknown accuracy, Sweden - onshore
PROJ string:
-+proj=vgridshift +grids=SWEN17_RH2000.gtx +multiplier=1
++proj=vgridshift +grids=se_lantmateriet_SWEN17_RH2000.tif +multiplier=1
WKT2:2019 string:
-COORDINATEOPERATION["RH2000 height to SWEREF99",
+COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height",
SOURCECRS[
VERTCRS["RH2000 height",
VDATUM["Rikets hojdsystem 2000"],
@@ -933,14 +933,14 @@ COORDINATEOPERATION["RH2000 height to SWEREF99",
ORDER[3],
LENGTHUNIT["metre",1]],
ID["EPSG",4977]]],
- METHOD["GravityRelatedHeight to Geographic3D",
- ID["PROJ","HEIGHT_TO_GEOGRAPHIC3D"]],
- PARAMETERFILE["Geoid (height correction) model file","SWEN17_RH2000.gtx"],
+ METHOD["Inverse of Geographic3D to GravityRelatedHeight (gtx)",
+ ID["INVERSE(EPSG)",9665]],
+ PARAMETERFILE["Geoid (height correction) model file","se_lantmateriet_SWEN17_RH2000.tif"],
USAGE[
SCOPE["unknown"],
AREA["Sweden - onshore"],
BBOX[55.28,10.93,69.07,24.17]],
- ID["PROJ","EPSG_5613_TO_EPSG_4977"]]
+ ID["INVERSE(DERIVED_FROM(PROJ))","EPSG_4977_TO_EPSG_5613"]]
Testing NAD83(2011) + NAVD88 height -> NAD83(2011) : projinfo -s EPSG:6349 -t EPSG:6319 --spatial-test intersects -o PROJ
Candidate operations found: 2