MCPcopy Create free account
hub / github.com/OSGeo/PROJ / _exportToJSON

Method _exportToJSON

src/iso19111/coordinatesystem.cpp:144–166  ·  view source on GitHub ↗

@cond Doxygen_Suppress

Source from the content-addressed store, hash-verified

142
143//! @cond Doxygen_Suppress
144void Meridian::_exportToJSON(
145 io::JSONFormatter *formatter) const // throw(FormattingException)
146{
147 auto writer = formatter->writer();
148 auto objectContext(
149 formatter->MakeObjectContext("Meridian", !identifiers().empty()));
150
151 const auto &l_long = longitude();
152 writer->AddObjKey("longitude");
153 const auto &unit = l_long.unit();
154 if (unit == common::UnitOfMeasure::DEGREE) {
155 writer->Add(l_long.value(), 15);
156 } else {
157 auto longitudeContext(formatter->MakeObjectContext(nullptr, false));
158 writer->AddObjKey("value");
159 writer->Add(l_long.value(), 15);
160 writer->AddObjKey("unit");
161 unit._exportToJSON(formatter);
162 }
163 if (formatter->outputId()) {
164 formatID(formatter);
165 }
166}
167//! @endcond
168
169// ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 14

directionFunction · 0.85
meridianFunction · 0.85
writerMethod · 0.80
AddObjKeyMethod · 0.80
AddMethod · 0.80
valueMethod · 0.80
outputIdMethod · 0.80
typeMethod · 0.80
has_valueMethod · 0.80
emptyMethod · 0.45
unitMethod · 0.45

Tested by

no test coverage detected