From 7396d4d96c3646a53b36477e15dafb4db52678cf Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 29 Sep 2021 23:32:10 +0200 Subject: CRS::identify(): fix ignoring CS order when identifying a geodetic CRS by a PROJ string with just the ellipsoid --- test/unit/test_crs.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/unit/test_crs.cpp') diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index f7c82b5e..c9c0c9a1 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -1638,6 +1638,24 @@ TEST(crs, geodeticcrs_identify_db) { EXPECT_EQ(res.front().second, 70); } + { + // 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(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" -- cgit v1.2.3