diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-06-29 12:23:37 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-06-30 11:14:46 +0200 |
| commit | a9c3567cf5f69d08a869bf17a9e284e8c8142956 (patch) | |
| tree | c7704fa27b47c2b79e19a23edc6594da02a464d9 /test/unit/test_c_api.cpp | |
| parent | 7a131de134e40c73795c7d2c1834bee1e45b16a6 (diff) | |
| download | PROJ-a9c3567cf5f69d08a869bf17a9e284e8c8142956.tar.gz PROJ-a9c3567cf5f69d08a869bf17a9e284e8c8142956.zip | |
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()
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
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 |
