From b62fdee0f34d960527af8fb0a8bf6344fcf78d4b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 4 Jan 2019 19:25:04 +0100 Subject: WKT export: no longer export Geographic 3D CRS in WKT1, unless strict mode is disabled --- test/unit/test_c_api.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/unit/test_c_api.cpp') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 096d970b..778c6bdf 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -420,6 +420,25 @@ TEST_F(CApi, proj_as_wkt) { EXPECT_TRUE(std::string(wkt).find("AXIS") != std::string::npos) << wkt; } + auto crs4979 = proj_create_from_wkt( + m_ctxt, + GeographicCRS::EPSG_4979->exportToWKT(WKTFormatter::create().get()) + .c_str(), + nullptr, nullptr, nullptr); + ObjectKeeper keeper_crs4979(crs4979); + ASSERT_NE(crs4979, nullptr); + + // STRICT=NO + { + EXPECT_EQ(proj_as_wkt(m_ctxt, crs4979, PJ_WKT1_GDAL, nullptr), nullptr); + + const char *const options[] = {"STRICT=NO", nullptr}; + auto wkt = proj_as_wkt(m_ctxt, crs4979, PJ_WKT1_GDAL, options); + ASSERT_NE(wkt, nullptr); + EXPECT_TRUE(std::string(wkt).find("GEOGCS[\"WGS 84\"") == 0) + << wkt; + } + // unsupported option { const char *const options[] = {"unsupported=yes", nullptr}; -- cgit v1.2.3