aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/sql/customizations.sql13
-rw-r--r--data/sql/grid_alternatives.sql77
-rw-r--r--test/cli/testprojinfo_out.dist14
-rw-r--r--test/unit/test_operation.cpp48
4 files changed, 92 insertions, 60 deletions
diff --git a/data/sql/customizations.sql b/data/sql/customizations.sql
index b0804ebd..6301bda9 100644
--- a/data/sql/customizations.sql
+++ b/data/sql/customizations.sql
@@ -83,19 +83,6 @@ INSERT INTO "helmert_transformation" VALUES('PROJ','WGS84_TO_WGS84_G1674','WGS 8
INSERT INTO "helmert_transformation" VALUES('PROJ','WGS84_TO_WGS84_G1762','WGS 84 to WGS 84 (G1762)','','Accuracy 2m','EPSG','9603','Geocentric translations (geog2D domain)','EPSG','4326','EPSG','9057','EPSG','1262',2.0,0,0,0,'EPSG','9001',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 "helmert_transformation" VALUES('PROJ','WGS84_TO_WGS84_TRANSIT','WGS 84 to WGS 84 (Transit)','','Accuracy 2m','EPSG','9603','Geocentric translations (geog2D domain)','EPSG','4326','EPSG','8888','EPSG','1262',2.0,0,0,0,'EPSG','9001',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);
---- Remove a few supersessions ---
-
--- TODO: remove this once https://github.com/OSGeo/proj-datumgrid/issues/55 is dealt with
--- The following supersessions are for geoid2012, replaced by geoid2018
--- but we don't have geoid2018 yet as PROJ grids, so remove for now those
--- supersessions
--- INSERT INTO "supersession" VALUES('grid_transformation','EPSG','6326','grid_transformation','EPSG','9229','EPSG');
--- INSERT INTO "supersession" VALUES('grid_transformation','EPSG','7646','grid_transformation','EPSG','9230','EPSG');
--- INSERT INTO "supersession" VALUES('grid_transformation','EPSG','7647','grid_transformation','EPSG','9231','EPSG');
-DELETE FROM supersession WHERE superseded_table_name = 'grid_transformation' AND superseded_auth_name = 'EPSG' AND superseded_code = '6326';
-DELETE FROM supersession WHERE superseded_table_name = 'grid_transformation' AND superseded_auth_name = 'EPSG' AND superseded_code = '7646';
-DELETE FROM supersession WHERE superseded_table_name = 'grid_transformation' AND superseded_auth_name = 'EPSG' AND superseded_code = '7647';
-
---- Geoid models -----
INSERT INTO "geoid_model" SELECT 'GEOID99', auth_name, code FROM grid_transformation WHERE auth_name = 'EPSG' AND grid_name LIKE 'g1999%' AND deprecated = 0;
diff --git a/data/sql/grid_alternatives.sql b/data/sql/grid_alternatives.sql
index eb752e44..ab81a2fa 100644
--- a/data/sql/grid_alternatives.sql
+++ b/data/sql/grid_alternatives.sql
@@ -361,6 +361,74 @@ INSERT INTO grid_alternatives(original_grid_name,
NULL, NULL, NULL, NULL);
----------------------------
+-- US GEOID99 height models
+----------------------------
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u01.bin', 'g1999u01.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u02.bin', 'g1999u02.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u03.bin', 'g1999u03.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u04.bin', 'g1999u04.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u05.bin', 'g1999u05.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u06.bin', 'g1999u06.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u07.bin', 'g1999u07.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g1999u08.bin', 'g1999u08.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+-- Not mapped:
+-- g1999a01.gtx to g1999a04.gtx : Alaska
+-- g1999h01.gtx : Hawaii
+-- g1999p01.gtx : Puerto Rico
+
+----------------------------
+-- US GEOID03 height models
+----------------------------
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('geoid03_conus.bin', 'geoid03_conus.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+-- Not mapped:
+-- g2003a01.gtx to g2003a04.gtx : Alaska
+-- g2003h01.gtx : Hawaii
+---g2003p01.gtx : Puerto Rico
+
+----------------------------
+-- US GEOID06 height models
+----------------------------
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('geoid06_ak.bin', 'geoid06_ak.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+----------------------------
+-- US GEOID09 height models
+----------------------------
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('geoid09_ak.bin', 'geoid09_ak.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('geoid09_conus.bin', 'geoid09_conus.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+-- Not mapped:
+-- g2009h01.gtx : Hawaii
+-- g2009g01.gtx : Guam and Northern Mariana Islands.
+-- g2009s01.gtx : American Samoa.
+-- g2009p01.gtx : Puerto Rico / U.S. Vigin Islands.
+
+----------------------------
-- US GEOID12B height models
----------------------------
@@ -444,6 +512,15 @@ INSERT INTO grid_alternatives(original_grid_name,
'proj-datumgrid-north-america',
NULL, NULL, NULL, NULL);
+----------------------------
+-- US GEOID18 height models
+----------------------------
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g2018u0.bin', 'g2018u0.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
+
+INSERT INTO grid_alternatives(original_grid_name, proj_grid_name, proj_grid_format, proj_method, inverse_direction, package_name, url, direct_download, open_license, directory)
+ VALUES ('g2018p0.bin', 'g2018p0.gtx', 'GTX', 'vgridshift', 1, 'proj-datumgrid-north-america', NULL, NULL, NULL, NULL);
----------------------------
-- French vertical grids
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index 40b8330a..2875626b 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -947,14 +947,14 @@ COORDINATEOPERATION["RH2000 height to SWEREF99",
ID["PROJ","EPSG_5613_TO_EPSG_4977"]]
Testing NAD83(2011) + NAVD88 height -> NAD83(2011) : projinfo -s EPSG:6349 -t EPSG:6319 --spatial-test intersects -o PROJ
-Candidate operations found: 3
+Candidate operations found: 2
-------------------------------------
Operation n°1:
-unknown id, Inverse of NAD83(2011) to NAVD88 height (1), 0.02 m, USA - CONUS - onshore
+unknown id, Inverse of NAD83(2011) to NAVD88 height (3), 0.015 m, USA - CONUS - onshore
PROJ string:
-+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=g2012bu0.gtx +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
++proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=g2018u0.gtx +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
-------------------------------------
Operation n°2:
@@ -964,14 +964,6 @@ unknown id, Inverse of NAD83(2011) to NAVD88 height (2), 0.02 m, USA - Alaska
PROJ string:
+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift +grids=g2012ba0.gtx +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
--------------------------------------
-Operation n°3:
-
-unknown id, Inverse of NAD83(2011) to NAVD88 height (3), 0.015 m, USA - CONUS - onshore
-
-PROJ string:
-+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=g2018u0.bin +multiplier=1 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
-
Testing NGF IGN69 height to RGF93: projinfo -s EPSG:5720 -t EPSG:4965 -o PROJ
Candidate operations found: 2
-------------------------------------
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 5e04bf23..328a04cc 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -7029,17 +7029,13 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- // Inv here since the grid is not known
- "+step +inv +proj=vgridshift +grids=geoid09_conus.bin "
+ "+step +proj=vgridshift +grids=geoid09_conus.gtx "
"+multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
- // CompoundCRS to Geog3DCRS, with same vertical unit, and with
- // ellipsoid height <--> vertical height correction that requires a
- // horizontal adjustment before and after (which is empty in practice here
- // as NAD83 to NAD83(2011) is no-op)
+ // NAD83 + NAVD88 height --> WGS 84
{
auto ctxt =
CoordinateOperationContext::create(authFactory, nullptr, 0.0);
@@ -7062,10 +7058,10 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
ASSERT_GE(list.size(), 2U);
EXPECT_EQ(list[0]->nameStr(),
- "NAD83 to NAD83(2011) (1) + "
- "Inverse of NAD83(2011) to NAVD88 height (1) + "
- "Inverse of NAD83 to NAD83(2011) (1) + "
- "NAD83 to WGS 84 (1)");
+ "NAD83 to WGS 84 (1) + "
+ "Inverse of NAD83(NSRS2007) to WGS 84 (1) + "
+ "Inverse of NAD83(NSRS2007) to NAVD88 height (1) + "
+ "NAD83(NSRS2007) to WGS 84 (1)");
EXPECT_EQ(list[0]->exportToPROJString(
PROJStringFormatter::create(
PROJStringFormatter::Convention::PROJ_5,
@@ -7074,28 +7070,8 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2012bu0.gtx "
- "+multiplier=1 "
- "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
- "+step +proj=axisswap +order=2,1");
-
- // Shows vertical step, and then horizontal step
- EXPECT_EQ(list[1]->nameStr(),
- "NAD83 to NAD83(2011) (1) + "
- "Inverse of NAD83(2011) to NAVD88 height (1) + "
- "Inverse of NAD83 to NAD83(2011) (1) + "
- "NAD83 to WGS 84 (18)");
- EXPECT_EQ(list[1]->exportToPROJString(
- PROJStringFormatter::create(
- PROJStringFormatter::Convention::PROJ_5,
- authFactory->databaseContext())
- .get()),
- "+proj=pipeline "
- "+step +proj=axisswap +order=2,1 "
- "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2012bu0.gtx "
+ "+step +proj=vgridshift +grids=geoid09_conus.gtx "
"+multiplier=1 "
- "+step +proj=hgridshift +grids=FL "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -7123,7 +7099,7 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
ASSERT_GE(list.size(), 2U);
EXPECT_EQ(list[0]->nameStr(),
- "Inverse of NAD83(2011) to NAVD88 height (1) + "
+ "Inverse of NAD83(2011) to NAVD88 height (3) + "
"Inverse of NAD83 to NAD83(2011) (1) + "
"NAD83 to WGS 84 (1)");
EXPECT_EQ(list[0]->exportToPROJString(
@@ -7134,14 +7110,14 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2012bu0.gtx "
+ "+step +proj=vgridshift +grids=g2018u0.gtx "
"+multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
// Shows vertical step, and then horizontal step
EXPECT_EQ(list[1]->nameStr(),
- "Inverse of NAD83(2011) to NAVD88 height (1) + "
+ "Inverse of NAD83(2011) to NAVD88 height (3) + "
"Inverse of NAD83 to NAD83(2011) (1) + "
"NAD83 to WGS 84 (18)");
EXPECT_EQ(list[1]->exportToPROJString(
@@ -7152,7 +7128,7 @@ TEST(operation, compoundCRS_to_geogCRS_3D_context) {
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
- "+step +proj=vgridshift +grids=g2012bu0.gtx "
+ "+step +proj=vgridshift +grids=g2018u0.gtx "
"+multiplier=1 "
"+step +proj=hgridshift +grids=FL "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
@@ -7184,7 +7160,7 @@ TEST(operation, compoundCRS_to_geogCRS_2D_promote_to_3D_context) {
ctxt);
// The checked value is not that important, but in case this changes,
// likely due to a EPSG upgrade, worth checking
- ASSERT_EQ(listCompoundToGeog2D.size(), 469U);
+ ASSERT_EQ(listCompoundToGeog2D.size(), 467U);
auto listGeog2DToCompound =
CoordinateOperationFactory::create()->createOperations(dst, nnSrc,