aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-09-29 23:32:10 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-09-29 23:32:10 +0200
commit7396d4d96c3646a53b36477e15dafb4db52678cf (patch)
tree0b1f7a43880978c49127620321f1cab6e6239380 /test/unit
parent64c38c2bc12f06ad994cfee57fe9e20f4bdcf272 (diff)
downloadPROJ-7396d4d96c3646a53b36477e15dafb4db52678cf.tar.gz
PROJ-7396d4d96c3646a53b36477e15dafb4db52678cf.zip
CRS::identify(): fix ignoring CS order when identifying a geodetic CRS by a PROJ string with just the ellipsoid
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_crs.cpp18
1 files changed, 18 insertions, 0 deletions
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
@@ -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"