aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-14 14:26:31 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-11-14 14:41:05 +0100
commit2305dec4384365524cef76db4f84214746c4bd95 (patch)
treef5f8ff41bbeb32e0b1b67c31017d219ccf814570 /test/unit/test_c_api.cpp
parent541ace23427371975a5aa6506120b41ef6c16aae (diff)
downloadPROJ-2305dec4384365524cef76db4f84214746c4bd95.tar.gz
PROJ-2305dec4384365524cef76db4f84214746c4bd95.zip
import/export PROJJSON: support a interpolation_crs key to geoid_model for faithful serialization of the geoid_geog_crs parameter of proj_create_vertical_crs_ex()
Diffstat (limited to 'test/unit/test_c_api.cpp')
-rw-r--r--test/unit/test_c_api.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index bdadc8b8..d8816acf 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -4320,6 +4320,27 @@ TEST_F(CApi, proj_create_vertical_crs_ex_with_geog_crs) {
"+step +proj=vgridshift +grids=@foo.gtx +multiplier=1 "
"+step +proj=unitconvert +xy_in=rad +xy_out=deg "
"+step +proj=axisswap +order=2,1");
+
+ // Check that we get the same results after an export of compoundCRS to
+ // PROJJSON and a re-import from it.
+ auto projjson = proj_as_projjson(m_ctxt, compound, nullptr);
+ ASSERT_NE(projjson, nullptr);
+ auto compound_from_projjson = proj_create(m_ctxt, projjson);
+ ObjectKeeper keeper_compound_from_projjson(compound_from_projjson);
+ ASSERT_NE(compound_from_projjson, nullptr);
+
+ auto P2 = proj_create_crs_to_crs_from_pj(m_ctxt, compound_from_projjson,
+ geog_crs, nullptr, nullptr);
+ ObjectKeeper keeper_P2(P2);
+ ASSERT_NE(P2, nullptr);
+
+ auto name_bis = proj_get_name(P2);
+ ASSERT_TRUE(name_bis != nullptr);
+ EXPECT_EQ(std::string(name_bis), std::string(name));
+
+ auto proj_5_bis = proj_as_proj_string(m_ctxt, P2, PJ_PROJ_5, nullptr);
+ ASSERT_NE(proj_5_bis, nullptr);
+ EXPECT_EQ(std::string(proj_5_bis), std::string(proj_5));
}
} // namespace