Skip to content

Commit

Permalink
Database: register 4 height Austrian grids from OSGeo/PROJ-data#13 + …
Browse files Browse the repository at this point in the history
…handle 'Vertical Offset by Grid Interpolation (BEV AT)' method
  • Loading branch information
rouault committed Feb 26, 2020
1 parent 1f8541d commit 250e4a2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/sql/grid_alternatives.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/iso19111/coordinateoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/proj_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
15 changes: 15 additions & 0 deletions test/unit/test_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 250e4a2

Please sign in to comment.