diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-14 14:59:27 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-14 14:59:27 +0100 |
| commit | ba313759523d6d24f7e027f5ddae230656141b3b (patch) | |
| tree | f80872c682383fee0e5f232bcc3ced2e4bdb4bc9 /test/unit/test_c_api.cpp | |
| parent | 4638b45730ab29b2891e57474fa9ee130d6b38a4 (diff) | |
| download | PROJ-ba313759523d6d24f7e027f5ddae230656141b3b.tar.gz PROJ-ba313759523d6d24f7e027f5ddae230656141b3b.zip | |
Advanced C API: add proj_obj_alter_id()
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 7384262b..4c1faf87 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -2446,6 +2446,29 @@ TEST_F(CApi, proj_obj_alter_name) { // --------------------------------------------------------------------------- +TEST_F(CApi, proj_obj_alter_id) { + + auto cs = proj_obj_create_ellipsoidal_2D_cs( + m_ctxt, PJ_ELLPS2D_LONGITUDE_LATITUDE, nullptr, 0); + ObjectKeeper keeper_cs(cs); + ASSERT_NE(cs, nullptr); + + auto obj = proj_obj_create_geographic_crs( + m_ctxt, "WGS 84", "World Geodetic System 1984", "WGS 84", 6378137, + 298.257223563, "Greenwich", 0.0, "Degree", 0.0174532925199433, cs); + ObjectKeeper keeper(obj); + ASSERT_NE(obj, nullptr); + + auto alteredObj = proj_obj_alter_id(m_ctxt, obj, "auth", "code"); + ObjectKeeper keeper_alteredObj(alteredObj); + ASSERT_NE(alteredObj, nullptr); + + EXPECT_EQ(std::string(proj_obj_get_id_auth_name(alteredObj, 0)), "auth"); + EXPECT_EQ(std::string(proj_obj_get_id_code(alteredObj, 0)), "code"); +} + +// --------------------------------------------------------------------------- + TEST_F(CApi, proj_obj_create_projected_crs) { PJ_PARAM_DESCRIPTION param; |
