aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/datum.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-08-09 17:10:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-08-09 17:41:23 +0200
commitf0d766e45640800412c08a7cb9ab4f8823d88d05 (patch)
tree1973086c9f52043d61fb1a71cbbc1c3a794c3afc /src/iso19111/datum.cpp
parent81bd57dfd8cfae609288643d1b09a4805f1bcded (diff)
downloadPROJ-f0d766e45640800412c08a7cb9ab4f8823d88d05.tar.gz
PROJ-f0d766e45640800412c08a7cb9ab4f8823d88d05.zip
PROJSJON: add import/export of VerticalCRS, CompoundCRS, BoundCRS, Transformation and ConcatenatedOperation
Diffstat (limited to 'src/iso19111/datum.cpp')
-rw-r--r--src/iso19111/datum.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp
index 2944da1e..d6e6bc21 100644
--- a/src/iso19111/datum.cpp
+++ b/src/iso19111/datum.cpp
@@ -1726,6 +1726,30 @@ void VerticalReferenceFrame::_exportToWKT(
// ---------------------------------------------------------------------------
//! @cond Doxygen_Suppress
+void VerticalReferenceFrame::_exportToJSON(
+ io::JSONFormatter *formatter) const // throw(FormattingException)
+{
+ auto objectContext(formatter->MakeObjectContext("VerticalReferenceFrame",
+ !identifiers().empty()));
+ auto &writer = formatter->writer();
+
+ writer.AddObjKey("name");
+ auto l_name = nameStr();
+ if (l_name.empty()) {
+ writer.Add("unnamed");
+ } else {
+ writer.Add(l_name);
+ }
+
+ Datum::getPrivate()->exportAnchorDefinition(formatter);
+
+ ObjectUsage::baseExportToJSON(formatter);
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
bool VerticalReferenceFrame::_isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion) const {
@@ -1989,6 +2013,32 @@ void TemporalDatum::_exportToWKT(
// ---------------------------------------------------------------------------
//! @cond Doxygen_Suppress
+void TemporalDatum::_exportToJSON(
+ io::JSONFormatter *formatter) const // throw(FormattingException)
+{
+ auto objectContext(
+ formatter->MakeObjectContext("TemporalDatum", !identifiers().empty()));
+ auto &writer = formatter->writer();
+
+ writer.AddObjKey("name");
+ writer.Add(nameStr());
+
+ writer.AddObjKey("calendar");
+ writer.Add(calendar());
+
+ const auto &timeOriginStr = temporalOrigin().toString();
+ if (!timeOriginStr.empty()) {
+ writer.AddObjKey("time_origin");
+ writer.Add(timeOriginStr);
+ }
+
+ ObjectUsage::baseExportToJSON(formatter);
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
bool TemporalDatum::_isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion) const {
@@ -2062,6 +2112,25 @@ void EngineeringDatum::_exportToWKT(
// ---------------------------------------------------------------------------
//! @cond Doxygen_Suppress
+void EngineeringDatum::_exportToJSON(
+ io::JSONFormatter *formatter) const // throw(FormattingException)
+{
+ auto objectContext(formatter->MakeObjectContext("EngineeringDatum",
+ !identifiers().empty()));
+ auto &writer = formatter->writer();
+
+ writer.AddObjKey("name");
+ writer.Add(nameStr());
+
+ Datum::getPrivate()->exportAnchorDefinition(formatter);
+
+ ObjectUsage::baseExportToJSON(formatter);
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
bool EngineeringDatum::_isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion) const {
@@ -2128,6 +2197,25 @@ void ParametricDatum::_exportToWKT(
// ---------------------------------------------------------------------------
//! @cond Doxygen_Suppress
+void ParametricDatum::_exportToJSON(
+ io::JSONFormatter *formatter) const // throw(FormattingException)
+{
+ auto objectContext(formatter->MakeObjectContext("ParametricDatum",
+ !identifiers().empty()));
+ auto &writer = formatter->writer();
+
+ writer.AddObjKey("name");
+ writer.Add(nameStr());
+
+ Datum::getPrivate()->exportAnchorDefinition(formatter);
+
+ ObjectUsage::baseExportToJSON(formatter);
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
bool ParametricDatum::_isEquivalentTo(
const util::IComparable *other,
util::IComparable::Criterion criterion) const {