MCPcopy Create free account
hub / github.com/Kitware/VTK / _exportToJSON

Method _exportToJSON

ThirdParty/libproj/vtklibproj/src/iso19111/datum.cpp:399–427  ·  view source on GitHub ↗

@cond Doxygen_Suppress

Source from the content-addressed store, hash-verified

397
398//! @cond Doxygen_Suppress
399void PrimeMeridian::_exportToJSON(
400 io::JSONFormatter *formatter) const // throw(FormattingException)
401{
402 auto writer = formatter->writer();
403 auto objectContext(
404 formatter->MakeObjectContext("PrimeMeridian", !identifiers().empty()));
405
406 writer->AddObjKey("name");
407 std::string l_name =
408 name()->description().has_value() ? nameStr() : "Greenwich";
409 writer->Add(l_name);
410
411 const auto &l_long = longitude();
412 writer->AddObjKey("longitude");
413 const auto &unit = l_long.unit();
414 if (unit == common::UnitOfMeasure::DEGREE) {
415 writer->Add(l_long.value(), 15);
416 } else {
417 auto longitudeContext(formatter->MakeObjectContext(nullptr, false));
418 writer->AddObjKey("value");
419 writer->Add(l_long.value(), 15);
420 writer->AddObjKey("unit");
421 unit._exportToJSON(formatter);
422 }
423
424 if (formatter->outputId()) {
425 formatID(formatter);
426 }
427}
428//! @endcond
429
430// ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 15

AddObjKeyMethod · 0.80
has_valueMethod · 0.80
outputIdMethod · 0.80
getSIValueMethod · 0.80
formatIDMethod · 0.80
nameClass · 0.50
writerMethod · 0.45
emptyMethod · 0.45
descriptionMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected