diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-24 19:16:12 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-11-24 19:52:39 +0100 |
| commit | 4caf32aedd4da6b1fd1b1ce0e04a1a08dc1e3f33 (patch) | |
| tree | 7b20f75b93c7322043a3fc39f86cc294bd2abb69 /test/unit/test_c_api.cpp | |
| parent | 5172091009069955a62a38237ad48fc0aabf0ed9 (diff) | |
| download | PROJ-4caf32aedd4da6b1fd1b1ce0e04a1a08dc1e3f33.tar.gz PROJ-4caf32aedd4da6b1fd1b1ce0e04a1a08dc1e3f33.zip | |
Add option to allow export of Geographic/Projected 3D CRS in WKT1_GDAL
as CompoundCRS with a VerticalCRS being an ellipsoidal height, which is
not conformant. But needed for LAS 1.4 that only supports WKT1
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 9885d221..c417371d 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -433,16 +433,27 @@ TEST_F(CApi, proj_as_wkt) { ObjectKeeper keeper_crs4979(crs4979); ASSERT_NE(crs4979, nullptr); + EXPECT_EQ(proj_as_wkt(m_ctxt, crs4979, PJ_WKT1_GDAL, nullptr), 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; } + // ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS=YES + { + const char *const options[] = { + "ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS=YES", nullptr}; + auto wkt = proj_as_wkt(m_ctxt, crs4979, PJ_WKT1_GDAL, options); + ASSERT_NE(wkt, nullptr); + EXPECT_TRUE(std::string(wkt).find( + "COMPD_CS[\"WGS 84 + Ellipsoid (metre)\"") == 0) + << wkt; + } + // unsupported option { const char *const options[] = {"unsupported=yes", nullptr}; |
