aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/iso19111/factory.cpp4
-rw-r--r--test/unit/test_factory.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 4894085e..a9d82268 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -5642,7 +5642,7 @@ AuthorityFactory::createObjectsFromNameEx(
sql += "AND deprecated = 1 ";
}
if (!approximateMatch) {
- sql += "AND name = ? ";
+ sql += "AND name = ? COLLATE NOCASE ";
params.push_back(searchedNameWithoutDeprecated);
}
if (d->hasAuthorityRestriction()) {
@@ -5672,7 +5672,7 @@ AuthorityFactory::createObjectsFromNameEx(
sql += "AND ov.deprecated = 1 ";
}
if (!approximateMatch) {
- sql += "AND a.alt_name = ? ";
+ sql += "AND a.alt_name = ? COLLATE NOCASE ";
params.push_back(searchedNameWithoutDeprecated);
}
if (d->hasAuthorityRestriction()) {
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index 780bdc9a..c34723f2 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -2782,6 +2782,12 @@ TEST(factory, createObjectsFromName) {
}
}
+ // Exact name, but just not the official case ==> should match with exact
+ // match
+ EXPECT_EQ(factory->createObjectsFromName("WGS 84 / utm zone 31n", {}, false)
+ .size(),
+ 1U);
+
// Prime meridian
EXPECT_EQ(factoryEPSG->createObjectsFromName("Paris", {}, false, 2).size(),
1U);