aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp51
1 files changed, 48 insertions, 3 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 8ee5814b..495c80c3 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -8062,7 +8062,6 @@ TEST(operation, compoundCRS_from_WKT2_no_id_to_geogCRS_3D_context) {
ASSERT_GE(list.size(), 1U);
{
- // Important here is vgridshift before hgridshift
auto op_proj =
list[0]->exportToPROJString(PROJStringFormatter::create().get());
EXPECT_EQ(
@@ -8070,8 +8069,8 @@ TEST(operation, compoundCRS_from_WKT2_no_id_to_geogCRS_3D_context) {
"+proj=pipeline +step +inv +proj=sterea +lat_0=52.1561605555556 "
"+lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 "
"+ellps=bessel "
- "+step +proj=vgridshift +grids=naptrans2008.gtx +multiplier=1 "
- "+step +proj=hgridshift +grids=rdtrans2008.gsb "
+ "+step +proj=hgridshift +grids=rdtrans2018.gsb "
+ "+step +proj=vgridshift +grids=nlgeo2018.gtx +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
}
@@ -9651,3 +9650,49 @@ TEST(operation, normalizeForVisualization) {
"+step +proj=unitconvert +xy_in=rad +xy_out=deg");
}
}
+
+// ---------------------------------------------------------------------------
+
+TEST(operation,
+ export_of_Geographic3D_to_GravityRelatedHeight_gtx_unknown_grid) {
+
+ auto wkt =
+ "COORDINATEOPERATION[\"bla\",\n"
+ " SOURCECRS[\n"
+ " GEOGCRS[\"ETRS89\",\n"
+ " DATUM[\"European Terrestrial Reference System 1989\",\n"
+ " ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n"
+ " LENGTHUNIT[\"metre\",1]]],\n"
+ " PRIMEM[\"Greenwich\",0,\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " CS[ellipsoidal,3],\n"
+ " AXIS[\"geodetic latitude (Lat)\",north,\n"
+ " ORDER[1],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"geodetic longitude (Lon)\",east,\n"
+ " ORDER[2],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"ellipsoidal height (h)\",up,\n"
+ " ORDER[3],\n"
+ " LENGTHUNIT[\"metre\",1]],\n"
+ " ID[\"EPSG\",4937]]],\n"
+ " TARGETCRS[\n"
+ " VERTCRS[\"bar\",\n"
+ " VDATUM[\"bar\"],\n"
+ " CS[vertical,1],\n"
+ " AXIS[\"gravity-related height (H)\",up,\n"
+ " LENGTHUNIT[\"metre\",1]]]],\n"
+ " METHOD[\"Geographic3D to GravityRelatedHeight (gtx)\",\n"
+ " ID[\"EPSG\",9665]],\n"
+ " PARAMETERFILE[\"Geoid (height correction) model "
+ "file\",\"foo.gtx\"]]";
+
+ auto obj = WKTParser().createFromWKT(wkt);
+ auto crs = nn_dynamic_pointer_cast<Transformation>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ // Test that even if the .gtx file is unkown, we export in the correct
+ // direction
+ EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +inv +proj=vgridshift +grids=foo.gtx "
+ "+multiplier=1");
+}