From 004e26293e258a9144e6e1d33049eb1753b82b89 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 12 May 2019 09:03:48 +0200 Subject: Fix identification of GeodeticCRS expressed by PROJ string for EPSG authority --- test/unit/test_crs.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/unit') diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index d7303df9..fbbd4f64 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -1498,6 +1498,19 @@ TEST(crs, geodeticcrs_identify_db) { ->identify(factory); ASSERT_EQ(res.size(), 0U); } + { + // Test identification from PROJ string + auto obj = PROJStringParser().createFromPROJString( + "+proj=longlat +datum=WGS84 +type=crs"); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + auto res = crs->identify(factory); + 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(), "4326"); + EXPECT_EQ(res.front().second, 70); + } } // --------------------------------------------------------------------------- -- cgit v1.2.3