diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-12-28 22:25:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-28 22:25:48 +0100 |
| commit | 26e07082d3900234a4ad93c2cf5c4de86eb2fe52 (patch) | |
| tree | d8f4caee267d0350137285aeb57839b28be2025a /test/unit/test_c_api.cpp | |
| parent | 9e7c39abac920a295e2ff76b6c0c5f2e789ebbfd (diff) | |
| parent | 882d84b086010e2a5088be11362db16217beab99 (diff) | |
| download | PROJ-26e07082d3900234a4ad93c2cf5c4de86eb2fe52.tar.gz PROJ-26e07082d3900234a4ad93c2cf5c4de86eb2fe52.zip | |
Merge pull request #2496 from rouault/proj_crs_is_derived
C API: add proj_crs_is_derived()
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index d43d68ce..60ad8f61 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -5183,4 +5183,30 @@ TEST_F(CApi, datum_ensemble) { } } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_crs_is_derived) { + { + auto wkt = + createProjectedCRS()->exportToWKT(WKTFormatter::create().get()); + auto obj = proj_create_from_wkt(m_ctxt, wkt.c_str(), nullptr, nullptr, + nullptr); + ObjectKeeper keeper(obj); + ASSERT_NE(obj, nullptr) << wkt; + + EXPECT_TRUE(proj_crs_is_derived(m_ctxt, obj)); + } + + { + auto wkt = createProjectedCRS()->baseCRS()->exportToWKT( + WKTFormatter::create().get()); + auto obj = proj_create_from_wkt(m_ctxt, wkt.c_str(), nullptr, nullptr, + nullptr); + ObjectKeeper keeper(obj); + ASSERT_NE(obj, nullptr) << wkt; + + EXPECT_FALSE(proj_crs_is_derived(m_ctxt, obj)); + } +} + } // namespace |
