aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-11-29 17:30:16 +0100
committerGitHub <noreply@github.com>2020-11-29 17:30:16 +0100
commitedd7f165f88958c1d3147150639b67b8dd60db09 (patch)
treec5524a280f5feeba1a0339b28ab8ac074cd1186e /test/unit/test_c_api.cpp
parent2ae0766eefc598c21d923a0e85d994b93c5fe7a4 (diff)
parent4caf32aedd4da6b1fd1b1ce0e04a1a08dc1e3f33 (diff)
downloadPROJ-edd7f165f88958c1d3147150639b67b8dd60db09.tar.gz
PROJ-edd7f165f88958c1d3147150639b67b8dd60db09.zip
Merge pull request #2450 from rouault/setAllowEllipsoidalHeightAsVerticalCRS
Add option to allow export of Geographic/Projected 3D CRS in WKT1_GDAL
Diffstat (limited to 'test/unit/test_c_api.cpp')
-rw-r--r--test/unit/test_c_api.cpp15
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};