From bd9ecbacf575a1926fb8e223c4add1a4cc45d7f3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 16 Dec 2019 15:23:22 +0100 Subject: identify(): take into datum name aliases (fixes #1800) --- src/iso19111/coordinatesystem.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/iso19111/coordinatesystem.cpp') diff --git a/src/iso19111/coordinatesystem.cpp b/src/iso19111/coordinatesystem.cpp index 6769b486..163f0f43 100644 --- a/src/iso19111/coordinatesystem.cpp +++ b/src/iso19111/coordinatesystem.cpp @@ -429,8 +429,8 @@ void CoordinateSystemAxis::_exportToJSON( //! @cond Doxygen_Suppress bool CoordinateSystemAxis::_isEquivalentTo( - const util::IComparable *other, - util::IComparable::Criterion criterion) const { + const util::IComparable *other, util::IComparable::Criterion criterion, + const io::DatabaseContextPtr &dbContext) const { auto otherCSA = dynamic_cast(other); if (otherCSA == nullptr) { return false; @@ -441,7 +441,7 @@ bool CoordinateSystemAxis::_isEquivalentTo( return false; } if (criterion == util::IComparable::Criterion::STRICT) { - if (!IdentifiedObject::_isEquivalentTo(other, criterion)) { + if (!IdentifiedObject::_isEquivalentTo(other, criterion, dbContext)) { return false; } if (abbreviation() != otherCSA->abbreviation()) { @@ -599,11 +599,11 @@ void CoordinateSystem::_exportToJSON( //! @cond Doxygen_Suppress bool CoordinateSystem::_isEquivalentTo( - const util::IComparable *other, - util::IComparable::Criterion criterion) const { + const util::IComparable *other, util::IComparable::Criterion criterion, + const io::DatabaseContextPtr &dbContext) const { auto otherCS = dynamic_cast(other); if (otherCS == nullptr || - !IdentifiedObject::_isEquivalentTo(other, criterion)) { + !IdentifiedObject::_isEquivalentTo(other, criterion, dbContext)) { return false; } const auto &list = axisList(); @@ -615,7 +615,8 @@ bool CoordinateSystem::_isEquivalentTo( return false; } for (size_t i = 0; i < list.size(); i++) { - if (!list[i]->_isEquivalentTo(otherList[i].get(), criterion)) { + if (!list[i]->_isEquivalentTo(otherList[i].get(), criterion, + dbContext)) { return false; } } -- cgit v1.2.3 From ea311993551f0019f38de361a5bc47fc630ee871 Mon Sep 17 00:00:00 2001 From: snowman2 Date: Wed, 1 Jan 2020 20:29:16 -0600 Subject: fix exporting CoordinateSystem to PROJ JSON with ID --- src/iso19111/coordinatesystem.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/iso19111/coordinatesystem.cpp') diff --git a/src/iso19111/coordinatesystem.cpp b/src/iso19111/coordinatesystem.cpp index 6769b486..688351f4 100644 --- a/src/iso19111/coordinatesystem.cpp +++ b/src/iso19111/coordinatesystem.cpp @@ -581,11 +581,13 @@ void CoordinateSystem::_exportToJSON( writer.Add(getWKT2Type(true)); writer.AddObjKey("axis"); - auto axisContext(writer.MakeArrayContext(false)); - const auto &l_axisList = axisList(); - for (auto &axis : l_axisList) { - formatter->setOmitTypeInImmediateChild(); - axis->_exportToJSON(formatter); + { + auto axisContext(writer.MakeArrayContext(false)); + const auto &l_axisList = axisList(); + for (auto &axis : l_axisList) { + formatter->setOmitTypeInImmediateChild(); + axis->_exportToJSON(formatter); + } } if (formatter->outputId()) { -- cgit v1.2.3