From 0d706c2c8b703c0720f8fce120542e6f650ac6d7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 22 Dec 2018 14:09:58 +0100 Subject: Support Projected 3D with method name suffixed with ' (3D)', and be more lax on projection parameter names --- src/crs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/crs.cpp') diff --git a/src/crs.cpp b/src/crs.cpp index d873e81b..55539e18 100644 --- a/src/crs.cpp +++ b/src/crs.cpp @@ -1060,7 +1060,7 @@ void GeodeticCRS::_exportToWKT(io::WKTFormatter *formatter) const { if (formatter->useESRIDialect()) { if (axisList.size() != 2) { io::FormattingException::Throw( - "Only export of Geographic 2D CRS is supported in ESRI_WKT1"); + "Only export of Geographic 2D CRS is supported in WKT1_ESRI"); } if (l_name == "WGS 84") { @@ -2590,6 +2590,10 @@ void ProjectedCRS::_exportToWKT(io::WKTFormatter *formatter) const { const auto &l_coordinateSystem = d->coordinateSystem(); const auto &axisList = l_coordinateSystem->axisList(); + if (axisList.size() == 3 && !(isWKT2 && formatter->use2018Keywords())) { + io::FormattingException::Throw( + "Projected 3D CRS can only be exported since WKT2:2018"); + } const auto exportAxis = [&l_coordinateSystem, &axisList, &formatter]() { const auto oldAxisOutputRule = formatter->outputAxis(); -- cgit v1.2.3