aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_crs.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-05-15 00:40:25 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-05-15 00:40:25 +0200
commita2f8fd1a21da1352a39cc56db2bb39613fc29091 (patch)
treec956aeaaa622f874a5152c4fa95547867728d972 /test/unit/test_crs.cpp
parent672b610dbccb37f7f0e1d73745b5a02331a3e090 (diff)
downloadPROJ-a2f8fd1a21da1352a39cc56db2bb39613fc29091.tar.gz
PROJ-a2f8fd1a21da1352a39cc56db2bb39613fc29091.zip
Make projinfo --3d --boundcrs-to-wgs84 better work (fixes #2202)
Diffstat (limited to 'test/unit/test_crs.cpp')
-rw-r--r--test/unit/test_crs.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index c00556a7..cf285b0a 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -5794,6 +5794,21 @@ TEST(crs, promoteTo3D_and_demoteTo2D) {
nn_dynamic_pointer_cast<ProjectedCRS>(crs3DAsBound->baseCRS());
ASSERT_TRUE(baseCRS != nullptr);
EXPECT_EQ(baseCRS->coordinateSystem()->axisList().size(), 3U);
+
+ auto hubCRS =
+ nn_dynamic_pointer_cast<GeographicCRS>(crs3DAsBound->hubCRS());
+ ASSERT_TRUE(hubCRS != nullptr);
+ EXPECT_EQ(hubCRS->coordinateSystem()->axisList().size(), 3U);
+
+ auto transfSrcCRS = nn_dynamic_pointer_cast<GeographicCRS>(
+ crs3DAsBound->transformation()->sourceCRS());
+ ASSERT_TRUE(transfSrcCRS != nullptr);
+ EXPECT_EQ(transfSrcCRS->coordinateSystem()->axisList().size(), 3U);
+
+ auto transfDstCRS = nn_dynamic_pointer_cast<GeographicCRS>(
+ crs3DAsBound->transformation()->targetCRS());
+ ASSERT_TRUE(transfDstCRS != nullptr);
+ EXPECT_EQ(transfDstCRS->coordinateSystem()->axisList().size(), 3U);
}
auto demoted = crs3DAsBound->demoteTo2D(std::string(), nullptr);
@@ -5804,6 +5819,21 @@ TEST(crs, promoteTo3D_and_demoteTo2D) {
nn_dynamic_pointer_cast<ProjectedCRS>(crs2DAsBound->baseCRS());
ASSERT_TRUE(baseCRS != nullptr);
EXPECT_EQ(baseCRS->coordinateSystem()->axisList().size(), 2U);
+
+ auto hubCRS =
+ nn_dynamic_pointer_cast<GeographicCRS>(crs2DAsBound->hubCRS());
+ ASSERT_TRUE(hubCRS != nullptr);
+ EXPECT_EQ(hubCRS->coordinateSystem()->axisList().size(), 2U);
+
+ auto transfSrcCRS = nn_dynamic_pointer_cast<GeographicCRS>(
+ crs2DAsBound->transformation()->sourceCRS());
+ ASSERT_TRUE(transfSrcCRS != nullptr);
+ EXPECT_EQ(transfSrcCRS->coordinateSystem()->axisList().size(), 2U);
+
+ auto transfDstCRS = nn_dynamic_pointer_cast<GeographicCRS>(
+ crs2DAsBound->transformation()->targetCRS());
+ ASSERT_TRUE(transfDstCRS != nullptr);
+ EXPECT_EQ(transfDstCRS->coordinateSystem()->axisList().size(), 2U);
}
}