diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-03-25 08:34:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-25 08:34:38 +0100 |
| commit | 85b1d84934d95c740f549c55c196a92487ff45a8 (patch) | |
| tree | ca679865e0648081e723c2e5db4a85de76f5df63 /src/iso19111/coordinateoperation.cpp | |
| parent | 56784e70f3903cd1a0a7a3d47dfef7f837400d28 (diff) | |
| parent | 8763ea7f01bd349df29c5c4ce3b4edd6252eff37 (diff) | |
| download | PROJ-85b1d84934d95c740f549c55c196a92487ff45a8.tar.gz PROJ-85b1d84934d95c740f549c55c196a92487ff45a8.zip | |
Merge pull request #1360 from rouault/update_parser_to_ogc_18_010r6
WKT2 parser: update to OGC 18-010r6
Diffstat (limited to 'src/iso19111/coordinateoperation.cpp')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 57cf9832..80c1a572 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -756,6 +756,15 @@ void CoordinateOperation::setHasBallparkTransformation(bool b) { // --------------------------------------------------------------------------- +void CoordinateOperation::setProperties( + const util::PropertyMap &properties) // throw(InvalidValueTypeException) +{ + ObjectUsage::setProperties(properties); + properties.getStringValue(OPERATION_VERSION_KEY, d->operationVersion_); +} + +// --------------------------------------------------------------------------- + //! @cond Doxygen_Suppress struct OperationMethod::Private { util::optional<std::string> formula_{}; @@ -6175,17 +6184,17 @@ TransformationNNPtr Transformation::create( throw InvalidOperation( "Inconsistent number of parameters and parameter values"); } - auto conv = Transformation::nn_make_shared<Transformation>( + auto transf = Transformation::nn_make_shared<Transformation>( sourceCRSIn, targetCRSIn, interpolationCRSIn, methodIn, values, accuracies); - conv->assignSelf(conv); - conv->setProperties(properties); + transf->assignSelf(transf); + transf->setProperties(properties); std::string name; if (properties.getStringValue(common::IdentifiedObject::NAME_KEY, name) && ci_find(name, "ballpark") != std::string::npos) { - conv->setHasBallparkTransformation(true); + transf->setHasBallparkTransformation(true); } - return conv; + return transf; } // --------------------------------------------------------------------------- @@ -7653,6 +7662,15 @@ void SingleOperation::exportTransformationToWKT( formatter->addQuotedString(nameStr()); + if (isWKT2 && formatter->use2018Keywords()) { + const auto &version = operationVersion(); + if (version.has_value()) { + formatter->startNode(io::WKTConstants::VERSION, false); + formatter->addQuotedString(*version); + formatter->endNode(); + } + } + if (!formatter->abridgedTransformation()) { formatter->startNode(io::WKTConstants::SOURCECRS, false); l_sourceCRS->_exportToWKT(formatter); @@ -9310,6 +9328,15 @@ void ConcatenatedOperation::_exportToWKT(io::WKTFormatter *formatter) const { !identifiers().empty()); formatter->addQuotedString(nameStr()); + if (isWKT2 && formatter->use2018Keywords()) { + const auto &version = operationVersion(); + if (version.has_value()) { + formatter->startNode(io::WKTConstants::VERSION, false); + formatter->addQuotedString(*version); + formatter->endNode(); + } + } + formatter->startNode(io::WKTConstants::SOURCECRS, false); sourceCRS()->_exportToWKT(formatter); formatter->endNode(); |
