aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-02-05 19:58:57 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-02-05 19:59:00 +0100
commit72925acb842d5541437a22038783fc1c71c22de6 (patch)
treeca6b6d01b9b03381573a68bba5d105dee2484744 /test/unit
parentc077e5b8b19a7c376bec1a68c2d20334236aed09 (diff)
downloadPROJ-72925acb842d5541437a22038783fc1c71c22de6.tar.gz
PROJ-72925acb842d5541437a22038783fc1c71c22de6.zip
Fix identification of ESRI-style datum names starting with D_ but without alias
Fixes #1911
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_crs.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 87efc59d..3b078427 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -1321,6 +1321,7 @@ TEST(crs, geodeticcrs_identify_no_db) {
TEST(crs, geodeticcrs_identify_db) {
auto dbContext = DatabaseContext::create();
auto factory = AuthorityFactory::create(dbContext, "EPSG");
+
{
// No match
auto res =
@@ -1627,6 +1628,26 @@ TEST(crs, geodeticcrs_identify_db) {
EXPECT_TRUE(res.front().first->_isEquivalentTo(
crs.get(), IComparable::Criterion::EQUIVALENT, dbContext));
}
+
+ {
+ // Identify "a" ESRI WKT representation of GDA2020. See #1911
+ auto wkt = "GEOGCS[\"GDA2020\",DATUM[\"D_GDA2020\","
+ "SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],"
+ "PRIMEM[\"Greenwich\",0.0],"
+ "UNIT[\"Degree\",0.017453292519943295]]";
+ auto obj =
+ WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
+ auto crs = nn_dynamic_pointer_cast<GeographicCRS>(obj);
+ ASSERT_TRUE(crs != nullptr);
+
+ auto allFactory = AuthorityFactory::create(dbContext, std::string());
+ auto res = crs->identify(allFactory);
+ ASSERT_EQ(res.size(), 1U);
+ ASSERT_TRUE(!res.front().first->identifiers().empty());
+ EXPECT_EQ(*res.front().first->identifiers()[0]->codeSpace(), "EPSG");
+ EXPECT_EQ(res.front().first->identifiers()[0]->code(), "7844");
+ EXPECT_EQ(res.front().second, 100);
+ }
}
// ---------------------------------------------------------------------------