aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/coordinateoperation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-03-24 20:01:45 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-03-24 20:40:09 +0100
commit8763ea7f01bd349df29c5c4ce3b4edd6252eff37 (patch)
treea105baa2bb96e9474d618af3e4dba54f05338f7d /src/iso19111/coordinateoperation.cpp
parent3e37b354194b4d42acd247c32ca97e45ac40af1e (diff)
downloadPROJ-8763ea7f01bd349df29c5c4ce3b4edd6252eff37.tar.gz
PROJ-8763ea7f01bd349df29c5c4ce3b4edd6252eff37.zip
WKT2 parser: update to OGC 18-010r6
- Allow ID[] in base CRS of Derived CRS - Allow VERSION[] in non-conversion coordinate operations - Use VERSION[] to set operationVersion member of CoordinateOperation - Export operationVersion in WKT2:2018
Diffstat (limited to 'src/iso19111/coordinateoperation.cpp')
-rw-r--r--src/iso19111/coordinateoperation.cpp37
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();