From a9c3567cf5f69d08a869bf17a9e284e8c8142956 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 29 Jun 2019 12:23:37 +0200 Subject: Database: import scope/remarks for coordinate operation and add C API - Import scope and remarks for coordinate operations of the EPSG dataset. Database size goes from 5.2 MB to 5.55 MB - Add proj_get_scope() and proj_get_remarks() --- test/unit/test_c_api.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'test/unit/test_c_api.cpp') diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 2e6ea2c7..99904fd4 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3375,4 +3375,49 @@ TEST_F(CApi, proj_normalize_for_visualization_with_alternatives_reverse) { EXPECT_NEAR(c.lp.phi, 42, 1e-8); } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_get_remarks) { + auto co = proj_create_from_database(m_ctxt, "EPSG", "8048", + PJ_CATEGORY_COORDINATE_OPERATION, false, + nullptr); + ObjectKeeper keeper(co); + ASSERT_NE(co, nullptr); + + auto remarks = proj_get_remarks(co); + ASSERT_NE(remarks, nullptr); + EXPECT_EQ( + remarks, + std::string("Scale difference in ppb where 1/billion = 1E-9. " + "Derivation excluded Cocos, Christmas and Macquarie " + "Islands but is applied there. See codes 8444-46 for " + "equivalents using NTv2 method. See code 8447 for " + "alternative including distortion model for Aus only.")); +} + +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_get_scope) { + { + auto co = proj_create_from_database(m_ctxt, "EPSG", "8048", + PJ_CATEGORY_COORDINATE_OPERATION, + false, nullptr); + ObjectKeeper keeper(co); + ASSERT_NE(co, nullptr); + + auto scope = proj_get_scope(co); + ASSERT_NE(scope, nullptr); + EXPECT_EQ(scope, + std::string("Conformal transformation of GDA94 coordinates " + "that have been derived through GNSS CORS.")); + } + { + auto P = proj_create(m_ctxt, "+proj=noop"); + ObjectKeeper keeper(P); + ASSERT_NE(P, nullptr); + auto scope = proj_get_scope(P); + ASSERT_EQ(scope, nullptr); + } +} + } // namespace -- cgit v1.2.3