aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-02-20 12:18:16 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-02-20 12:57:01 +0100
commit70bc293a43def169fa34ed8e97a5cb06b336f247 (patch)
tree180d6a05361c2c7c7e8a800572066a16d277a7e0 /test/unit/test_operation.cpp
parent3664cb546811146c588cab6db41b1ccef6fcee7a (diff)
downloadPROJ-70bc293a43def169fa34ed8e97a5cb06b336f247.tar.gz
PROJ-70bc293a43def169fa34ed8e97a5cb06b336f247.zip
Vertical CRS transformation: synthetize a vertical unit change transformation when needed, and also sort Null geographic offset transformation in last
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 9a968378..42f8fe76 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -4362,7 +4362,7 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
authFactory->createCoordinateReferenceSystem("4275"), // NTF
authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
ctxt);
- ASSERT_EQ(list.size(), 3U);
+ ASSERT_EQ(list.size(), 2U);
EXPECT_EQ(
list[0]->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline +step +proj=push +v_3 +step +proj=axisswap "
@@ -4376,12 +4376,6 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
PROJStringFormatter::Convention::PROJ_5,
authFactory->databaseContext())
.get()),
- "");
- EXPECT_EQ(list[2]->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=hgridshift +grids=ntf_r93.gsb +step +proj=unitconvert "
@@ -6136,7 +6130,8 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
authFactory->createCoordinateReferenceSystem("7406"),
// NAD83(NSRS2007) + NAVD88 height
authFactory->createCoordinateReferenceSystem("5500"), ctxt);
- ASSERT_EQ(list.size(), 88U);
+ // 152 or 155 depending if the VERTCON grids are there
+ ASSERT_GE(list.size(), 152U);
EXPECT_EQ(list[0]->nameStr(), "NGVD29 height (ftUS) to NAVD88 height (3) + "
"NAD27 to WGS 84 (79) + Inverse of "
"NAD83(NSRS2007) to WGS 84 (1)");
@@ -6147,6 +6142,35 @@ TEST(operation, compoundCRS_to_compoundCRS_context) {
"+step +proj=hgridshift +grids=conus +step +proj=push +v_3 +step "
"+proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap "
"+order=2,1 +step +proj=pop +v_3");
+
+ bool foundApprox = false;
+ for (size_t i = 0; i < list.size(); i++) {
+ auto projString =
+ list[i]->exportToPROJString(PROJStringFormatter::create().get());
+ EXPECT_TRUE(
+ projString.find("+proj=pipeline +step +proj=axisswap +order=2,1 "
+ "+step +proj=unitconvert +xy_in=deg +z_in=us-ft "
+ "+xy_out=rad +z_out=m") == 0)
+ << list[i]->nameStr();
+ if (list[i]->nameStr().find("Transformation from NGVD29 height (ftUS) "
+ "to NAVD88 height (approximate "
+ "transformation)") == 0) {
+ EXPECT_EQ(list[i]->nameStr(),
+ "Transformation from NGVD29 height (ftUS) to NAVD88 "
+ "height (approximate transformation) + NAD27 to WGS 84 "
+ "(79) + Inverse of NAD83(NSRS2007) to WGS 84 (1)");
+ EXPECT_EQ(projString,
+ "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+ "+proj=unitconvert +xy_in=deg +z_in=us-ft +xy_out=rad "
+ "+z_out=m +step +proj=hgridshift +grids=conus +step "
+ "+proj=push +v_3 +step +proj=unitconvert +xy_in=rad "
+ "+xy_out=deg +step +proj=axisswap +order=2,1 +step "
+ "+proj=pop +v_3");
+ foundApprox = true;
+ break;
+ }
+ }
+ EXPECT_TRUE(foundApprox);
}
// ---------------------------------------------------------------------------