From 250e4a222bb267b33d9404ae31a1d09a0e4e16d3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 26 Feb 2020 16:23:39 +0100 Subject: [PATCH] Database: register 4 height Austrian grids from https://github.com/OSGeo/PROJ-data/pull/13 + handle 'Vertical Offset by Grid Interpolation (BEV AT)' method --- data/sql/grid_alternatives.sql | 4 ++++ src/iso19111/coordinateoperation.cpp | 2 ++ src/proj_constants.h | 3 +++ test/unit/test_operation.cpp | 15 +++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/data/sql/grid_alternatives.sql b/data/sql/grid_alternatives.sql index e545c7bf41..c7e0705017 100644 --- a/data/sql/grid_alternatives.sql +++ b/data/sql/grid_alternatives.sql @@ -20,6 +20,10 @@ VALUES ('SeTa2016.gsb','de_lgvl_saarland_SeTa2016.tif','SeTa2016.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/de_lgvl_saarland_SeTa2016.tif',1,1,NULL), ('NTv2_SN.gsb','de_geosn_NTv2_SN.tif','NTv2_SN.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/de_geosn_NTv2_SN.tif',1,1,NULL), ('AT_GIS_GRID.gsb','at_bev_AT_GIS_GRID.tif','AT_GIS_GRID.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/at_bev_AT_GIS_GRID.tif',1,1,NULL), +('GV_HoehenGrid_V1.csv','at_bev_GV_Hoehengrid_V1.tif',NULL,'GTiff','vgridshift',0,NULL,'https://cdn.proj.org/at_bev_GV_Hoehengrid_V1.tif',1,1,NULL), +('GEOID_GRS80_Oesterreich.csv','at_bev_GEOID_GRS80_Oesterreich.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/at_bev_GEOID_GRS80_Oesterreich.tif',1,1,NULL), +('GEOID_BESSEL_Oesterreich.csv','at_bev_GEOID_BESSEL_Oesterreich.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/at_bev_GEOID_BESSEL_Oesterreich.tif',1,1,NULL), +('GV_Hoehengrid_plus_Geoid_V3.csv','at_bev_GV_Hoehengrid_plus_Geoid_V2.tif',NULL,'GTiff','geoid_like',0,NULL,'https://cdn.proj.org/at_bev_GV_Hoehengrid_plus_Geoid_V2.tif',1,1,NULL), ('nzgd2kgrid0005.gsb','nz_linz_nzgd2kgrid0005.tif','nzgd2kgrid0005.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/nz_linz_nzgd2kgrid0005.tif',1,1,NULL), ('OSTN15_NTv2_OSGBtoETRS.gsb','uk_os_OSTN15_NTv2_OSGBtoETRS.tif','OSTN15_NTv2_OSGBtoETRS.gsb','GTiff','hgridshift',0,NULL,'https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif',1,1,NULL), -- Continental USA VERTCON: NGVD (19)29 height to NAVD (19)88 height diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index c97763e44c..16325423b8 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8867,6 +8867,7 @@ TransformationNNPtr Transformation::substitutePROJAlternativeGridNames( if (methodEPSGCode == EPSG_CODE_METHOD_VERTCON || methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD || + methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_BEV_AT || methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_GTX) { auto fileParameter = parameterValue(EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE, @@ -9619,6 +9620,7 @@ void Transformation::_exportToPROJString( } if (methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_NZLVD || + methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_BEV_AT || methodEPSGCode == EPSG_CODE_METHOD_VERTICALGRID_GTX) { auto fileParameter = parameterValue(EPSG_NAME_PARAMETER_VERTICAL_OFFSET_FILE, diff --git a/src/proj_constants.h b/src/proj_constants.h index 5b95cda6dd..891044625f 100644 --- a/src/proj_constants.h +++ b/src/proj_constants.h @@ -536,6 +536,9 @@ #define EPSG_CODE_METHOD_VERTICALGRID_NZLVD 1071 #define EPSG_NAME_METHOD_VERTICALGRID_NZLVD "Vertical Offset by Grid Interpolation (NZLVD)" +#define EPSG_CODE_METHOD_VERTICALGRID_BEV_AT 1080 +#define EPSG_NAME_METHOD_VERTICALGRID_BEV_AT "Vertical Offset by Grid Interpolation (BEV AT)" + #define EPSG_CODE_METHOD_VERTICALGRID_GTX 1084 #define EPSG_NAME_METHOD_VERTICALGRID_GTX "Vertical Offset by Grid Interpolation (gtx)" diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index fb611f68c5..84415efb05 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -6753,6 +6753,21 @@ TEST(operation, transformation_NZLVD_to_PROJ_string) { "+multiplier=1"); } +// --------------------------------------------------------------------------- + +TEST(operation, transformation_BEV_AT_to_PROJ_string) { + auto dbContext = DatabaseContext::create(); + auto factory = AuthorityFactory::create(dbContext, "EPSG"); + auto op = factory->createCoordinateOperation("9275", false); + EXPECT_EQ(op->exportToPROJString( + PROJStringFormatter::create( + PROJStringFormatter::Convention::PROJ_5, dbContext) + .get()), + "+proj=vgridshift +grids=at_bev_GV_Hoehengrid_V1.tif " + "+multiplier=1"); +} + + // --------------------------------------------------------------------------- TEST(operation, transformation_longitude_rotation_to_PROJ_string) {