aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-14 17:38:59 +0100
committerGitHub <noreply@github.com>2019-11-14 17:38:59 +0100
commitfab6ae78eaea6881d24d2554be642bc1d2099a7e (patch)
treef5f8ff41bbeb32e0b1b67c31017d219ccf814570 /test/unit/test_c_api.cpp
parent448af96a817b86fcd38c07c2a0c3b183cd988ef2 (diff)
parent2305dec4384365524cef76db4f84214746c4bd95 (diff)
downloadPROJ-fab6ae78eaea6881d24d2554be642bc1d2099a7e.tar.gz
PROJ-fab6ae78eaea6881d24d2554be642bc1d2099a7e.zip
Merge pull request #1732 from rouault/better_export_proj_create_vertical_crs_ex_to_projjson
import/export PROJJSON: support a interpolation_crs key to geoid_model
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