diff options
Diffstat (limited to 'test/unit/test_crs.cpp')
| -rw-r--r-- | test/unit/test_crs.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index 42e6018b..c9c0c9a1 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -1639,6 +1639,24 @@ TEST(crs, geodeticcrs_identify_db) { } { + // Test identification from PROJ string with just the ellipsoid + auto obj = PROJStringParser().createFromPROJString( + "+proj=longlat +ellps=GRS80 +type=crs"); + auto crs = nn_dynamic_pointer_cast<GeographicCRS>(obj); + ASSERT_TRUE(crs != nullptr); + auto res = crs->identify(factory); + bool foundGDA2020 = false; + for (const auto &pair : res) { + // one among many others... + if (pair.first->getEPSGCode() == 7844) { + foundGDA2020 = true; + EXPECT_EQ(pair.second, 60); + } + } + EXPECT_TRUE(foundGDA2020); + } + + { // Identify by code, but datum name is an alias of the official one auto wkt = "GEOGCRS[\"GDA2020\",\n" " DATUM[\"GDA2020\",\n" @@ -5401,6 +5419,9 @@ TEST(crs, derivedProjectedCRS_WKT2_2019) { EXPECT_TRUE(crs->isEquivalentTo(crs.get())); EXPECT_TRUE(crs->shallowClone()->isEquivalentTo(crs.get())); EXPECT_FALSE(crs->isEquivalentTo(createUnrelatedObject().get())); + + auto geodCRS = crs->extractGeodeticCRS(); + EXPECT_TRUE(geodCRS != nullptr); } // --------------------------------------------------------------------------- |
