diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-12-17 16:52:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-17 16:52:08 +0100 |
| commit | 9db6e144ae10854a5aff46fad2584c840c251974 (patch) | |
| tree | 433d4c96ff925827beb2e8cce8988cbba9fd1eee /test/unit/test_c_api.cpp | |
| parent | da7ffcd528595acb97589d59319967d01d8e5e8f (diff) | |
| parent | 75a3299803beabf2dd2600aee2b5849347dabc29 (diff) | |
| download | PROJ-9db6e144ae10854a5aff46fad2584c840c251974.tar.gz PROJ-9db6e144ae10854a5aff46fad2584c840c251974.zip | |
Merge pull request #1803 from rouault/improve_identification_with_datum_name_aliases
identify(): take into datum name aliases (fixes #1800)
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 22e2ac11..78e6bced 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -4464,4 +4464,35 @@ TEST_F(CApi, proj_create_derived_geographic_crs) { "+o_lat_p=-2 +lon_0=3 +datum=WGS84 +no_defs " "+type=crs")); } + +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_is_equivalent_to_with_ctx) { + auto from_epsg = proj_create_from_database(m_ctxt, "EPSG", "7844", + PJ_CATEGORY_CRS, false, nullptr); + ObjectKeeper keeper_from_epsg(from_epsg); + ASSERT_NE(from_epsg, nullptr); + + auto wkt = "GEOGCRS[\"GDA2020\",\n" + " DATUM[\"GDA2020\",\n" + " ELLIPSOID[\"GRS_1980\",6378137,298.257222101,\n" + " LENGTHUNIT[\"metre\",1]]],\n" + " PRIMEM[\"Greenwich\",0,\n" + " ANGLEUNIT[\"Degree\",0.0174532925199433]],\n" + " CS[ellipsoidal,2],\n" + " AXIS[\"geodetic latitude (Lat)\",north,\n" + " ORDER[1],\n" + " ANGLEUNIT[\"degree\",0.0174532925199433]],\n" + " AXIS[\"geodetic longitude (Lon)\",east,\n" + " ORDER[2],\n" + " ANGLEUNIT[\"degree\",0.0174532925199433]]]"; + auto from_wkt = + proj_create_from_wkt(m_ctxt, wkt, nullptr, nullptr, nullptr); + ObjectKeeper keeper_from_wkt(from_wkt); + EXPECT_NE(from_wkt, nullptr); + + EXPECT_TRUE(proj_is_equivalent_to_with_ctx(m_ctxt, from_epsg, from_wkt, + PJ_COMP_EQUIVALENT)); +} + } // namespace |
