From 6ef286ec69e7f6e3b1fba55e14aed209fbf705c0 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 22 Feb 2021 16:37:26 +0100 Subject: isEquivalentName(): fix for GDAL test failure https://github.com/OSGeo/PROJ/pull/2536 changed the name of the ellps=intl to "International 1924 (Hayford 1909, 1910)" When writing a GeoTIFF file from GDAL using a SRS built from a PROJ string, GDAL massages the datum name to "Unknown_based_on_International_1924_Hayford_1909_1910_ellipsoid" Before this fix, this wasn't considered as equivaleent to the non-massaged datum name "Unknown based on International 1924 (Hayford 1909, 1910) ellipsoid" --- src/iso19111/metadata.cpp | 2 +- test/unit/test_metadata.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/iso19111/metadata.cpp b/src/iso19111/metadata.cpp index fc788a30..e8ce37c6 100644 --- a/src/iso19111/metadata.cpp +++ b/src/iso19111/metadata.cpp @@ -1124,7 +1124,7 @@ void Identifier::_exportToJSON(JSONFormatter *formatter) const { //! @cond Doxygen_Suppress static bool isIgnoredChar(char ch) { return ch == ' ' || ch == '_' || ch == '-' || ch == '/' || ch == '(' || - ch == ')' || ch == '.' || ch == '&'; + ch == ')' || ch == '.' || ch == '&' || ch == ','; } //! @endcond diff --git a/test/unit/test_metadata.cpp b/test/unit/test_metadata.cpp index e12788b4..7cbc7de7 100644 --- a/test/unit/test_metadata.cpp +++ b/test/unit/test_metadata.cpp @@ -391,4 +391,8 @@ TEST(metadata, Identifier_isEquivalentName) { EXPECT_TRUE(Identifier::isEquivalentName("a", "\xc3\xa1")); EXPECT_TRUE(Identifier::isEquivalentName("\xc3\xa4", "\xc3\xa1")); + + EXPECT_TRUE(Identifier::isEquivalentName( + "Unknown based on International 1924 (Hayford 1909, 1910) ellipsoid", + "Unknown_based_on_International_1924_Hayford_1909_1910_ellipsoid")); } -- cgit v1.2.3