aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/iso19111/io.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index b6aadb8b..84f2ba76 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -3797,6 +3797,12 @@ WKTParser::Private::buildProjectedCRS(const WKTNodeNNPtr &node) {
ThrowNotExpectedCSType("Cartesian");
}
+ if (cartesianCS->axisList().size() == 3 &&
+ baseGeodCRS->coordinateSystem()->axisList().size() == 2) {
+ baseGeodCRS = NN_NO_CHECK(util::nn_dynamic_pointer_cast<GeodeticCRS>(
+ baseGeodCRS->promoteTo3D(std::string(), dbContext_)));
+ }
+
addExtensionProj4ToProp(nodeP, props);
return ProjectedCRS::create(props, baseGeodCRS, conversion,