diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-22 14:09:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-22 14:09:35 +0100 |
| commit | a95431d8666db9953115a3a824db396f8aa82b52 (patch) | |
| tree | 21117e52f95b8f36880efef8cd71c1fcec21242c /src/iso19111/common.cpp | |
| parent | c5fb54168665d41503ef3a08f0534da58949b632 (diff) | |
| parent | 4724025e6c817761052fc0dc8810fd489a9e0104 (diff) | |
| download | PROJ-a95431d8666db9953115a3a824db396f8aa82b52.tar.gz PROJ-a95431d8666db9953115a3a824db396f8aa82b52.zip | |
Merge pull request #1855 from rouault/rfc4_merge_back_master
[RFC4_dev] Merge master back to rfc4 latest branch
Diffstat (limited to 'src/iso19111/common.cpp')
| -rw-r--r-- | src/iso19111/common.cpp | 33 |
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 |
