aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/common.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-17 00:24:03 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-17 00:52:19 +0100
commit4724025e6c817761052fc0dc8810fd489a9e0104 (patch)
tree21117e52f95b8f36880efef8cd71c1fcec21242c /src/iso19111/common.cpp
parent66fd99a8831955034cb25c8468ecfe1f9d3a7d62 (diff)
parentd76e6202d27c730b4dcbf16b8c1575c11b703485 (diff)
downloadPROJ-4724025e6c817761052fc0dc8810fd489a9e0104.tar.gz
PROJ-4724025e6c817761052fc0dc8810fd489a9e0104.zip
Merge branch 'master' into rfc4_merge_back_master
Diffstat (limited to 'src/iso19111/common.cpp')
-rw-r--r--src/iso19111/common.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/iso19111/common.cpp b/src/iso19111/common.cpp
index 97900bda..f2e4de4c 100644
--- a/src/iso19111/common.cpp
+++ b/src/iso19111/common.cpp
@@ -901,19 +901,19 @@ void IdentifiedObject::formatRemarks(JSONFormatter *formatter) const {
// ---------------------------------------------------------------------------
bool IdentifiedObject::_isEquivalentTo(
- const util::IComparable *other,
- util::IComparable::Criterion criterion) const {
+ const util::IComparable *other, util::IComparable::Criterion criterion,
+ const io::DatabaseContextPtr &dbContext) const {
auto otherIdObj = dynamic_cast<const IdentifiedObject *>(other);
if (!otherIdObj)
return false;
- return _isEquivalentTo(otherIdObj, criterion);
+ return _isEquivalentTo(otherIdObj, criterion, dbContext);
}
// ---------------------------------------------------------------------------
-bool IdentifiedObject::_isEquivalentTo(const IdentifiedObject *otherIdObj,
- util::IComparable::Criterion criterion)
- PROJ_PURE_DEFN {
+bool IdentifiedObject::_isEquivalentTo(
+ const IdentifiedObject *otherIdObj, util::IComparable::Criterion criterion,
+ const io::DatabaseContextPtr &dbContext) PROJ_PURE_DEFN {
if (criterion == util::IComparable::Criterion::STRICT) {
if (!ci_equal(nameStr(), otherIdObj->nameStr())) {
return false;
@@ -922,12 +922,19 @@ bool IdentifiedObject::_isEquivalentTo(const IdentifiedObject *otherIdObj,
} else {
if (!metadata::Identifier::isEquivalentName(
nameStr().c_str(), otherIdObj->nameStr().c_str())) {
- return false;
+ return hasEquivalentNameToUsingAlias(otherIdObj, dbContext);
}
}
return true;
}
+// ---------------------------------------------------------------------------
+
+bool IdentifiedObject::hasEquivalentNameToUsingAlias(
+ const IdentifiedObject *, const io::DatabaseContextPtr &) const {
+ return false;
+}
+
//! @endcond
// ---------------------------------------------------------------------------
@@ -1092,8 +1099,8 @@ void ObjectDomain::_exportToJSON(JSONFormatter *formatter) const {
//! @cond Doxygen_Suppress
bool ObjectDomain::_isEquivalentTo(
- const util::IComparable *other,
- util::IComparable::Criterion criterion) const {
+ const util::IComparable *other, util::IComparable::Criterion criterion,
+ const io::DatabaseContextPtr &dbContext) const {
auto otherDomain = dynamic_cast<const ObjectDomain *>(other);
if (!otherDomain)
return false;
@@ -1106,7 +1113,7 @@ bool ObjectDomain::_isEquivalentTo(
return false;
return domainOfValidity().get() == nullptr ||
domainOfValidity()->_isEquivalentTo(
- otherDomain->domainOfValidity().get(), criterion);
+ otherDomain->domainOfValidity().get(), criterion, dbContext);
}
//! @endcond
@@ -1249,14 +1256,14 @@ void ObjectUsage::baseExportToJSON(JSONFormatter *formatter) const {
//! @cond Doxygen_Suppress
bool ObjectUsage::_isEquivalentTo(
- const util::IComparable *other,
- util::IComparable::Criterion criterion) const {
+ const util::IComparable *other, util::IComparable::Criterion criterion,
+ const io::DatabaseContextPtr &dbContext) const {
auto otherObjUsage = dynamic_cast<const ObjectUsage *>(other);
if (!otherObjUsage)
return false;
// TODO: incomplete
- return IdentifiedObject::_isEquivalentTo(other, criterion);
+ return IdentifiedObject::_isEquivalentTo(other, criterion, dbContext);
}
//! @endcond