aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-04-03 08:06:33 +0000
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2020-04-03 08:06:33 +0000
commit4d9027a3e2a9e130e61ad764cfa4be09539d70d2 (patch)
tree2c5cd425fef45e60279598053d3e7aa575c44fa5 /test/unit
parent49ad77477a8dda8154a64424c297ee747287724a (diff)
downloadPROJ-4d9027a3e2a9e130e61ad764cfa4be09539d70d2.tar.gz
PROJ-4d9027a3e2a9e130e61ad764cfa4be09539d70d2.zip
Make sure that importing a Projected 3D CRS from WKT:2019 keeps the base geographic CRS as 3D (fixes #2122)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_crs.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index c2e97003..ed6fb7d2 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -5644,6 +5644,22 @@ TEST(crs, promoteTo3D_and_demoteTo2D) {
EXPECT_EQ(
crs3DAsProjected->baseCRS()->coordinateSystem()->axisList().size(),
3U);
+
+ // Check that importing an exported Projected 3D CRS as WKT keeps
+ // the 3D aspect of the baseCRS (see #2122)
+ {
+ WKTFormatterNNPtr f(
+ WKTFormatter::create(WKTFormatter::Convention::WKT2_2019));
+ crs3DAsProjected->exportToWKT(f.get());
+ auto obj = WKTParser().createFromWKT(f->toString());
+ auto crsFromWkt = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
+ ASSERT_TRUE(crsFromWkt != nullptr);
+ EXPECT_EQ(crsFromWkt->coordinateSystem()->axisList().size(), 3U);
+ EXPECT_EQ(
+ crsFromWkt->baseCRS()->coordinateSystem()->axisList().size(),
+ 3U);
+ }
+
EXPECT_TRUE(crs3D->promoteTo3D(std::string(), nullptr)
->isEquivalentTo(crs3D.get()));