aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/factory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-09-15 00:28:25 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-09-15 00:28:25 +0200
commit7f0946ab38ad7dd5077a3970e7ed5f647365fa7b (patch)
tree11e8914573c734cd649308dcf3f8438f6aec6008 /src/iso19111/factory.cpp
parent47fb85bdf0e45bf5660e0b1dbde7b76f8824a87a (diff)
downloadPROJ-7f0946ab38ad7dd5077a3970e7ed5f647365fa7b.tar.gz
PROJ-7f0946ab38ad7dd5077a3970e7ed5f647365fa7b.zip
isEquivalentTo(): improve comparison of datum names based on official name and aliases (preparation for EPSG v10.035 update)
Diffstat (limited to 'src/iso19111/factory.cpp')
-rw-r--r--src/iso19111/factory.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 4ea9d2ad..f4228532 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -3430,6 +3430,29 @@ std::list<std::string> DatabaseContext::getAliases(
// ---------------------------------------------------------------------------
+/** \brief Return the 'name' column of a table for an object
+ *
+ * @param tableName Table name/category.
+ * @param authName Authority name of the object.
+ * @param code Code of the object
+ * @return Name (or empty)
+ * @throw FactoryException
+ */
+std::string DatabaseContext::getName(const std::string &tableName,
+ const std::string &authName,
+ const std::string &code) const {
+ std::string sql("SELECT name FROM \"");
+ sql += replaceAll(tableName, "\"", "\"\"");
+ sql += "\" WHERE auth_name = ? AND code = ?";
+ auto res = d->run(sql, {authName, code});
+ if (res.empty()) {
+ return std::string();
+ }
+ return res.front()[0];
+}
+
+// ---------------------------------------------------------------------------
+
/** \brief Return the 'text_definition' column of a table for an object
*
* @param tableName Table name/category.