diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-08-08 20:04:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 13:22:25 +0200 |
| commit | 89f2cc7ec4178a369e73e9cd115a2552a55d870a (patch) | |
| tree | b5a96d4248a0bb866477ed3c865fdb5648dc0a06 /src/iso19111/coordinatesystem.cpp | |
| parent | ec49c9cd0aa9de24623920b8de226daf05a0e90f (diff) | |
| download | PROJ-89f2cc7ec4178a369e73e9cd115a2552a55d870a.tar.gz PROJ-89f2cc7ec4178a369e73e9cd115a2552a55d870a.zip | |
PROJJSON export: use more compact form
Diffstat (limited to 'src/iso19111/coordinatesystem.cpp')
| -rw-r--r-- | src/iso19111/coordinatesystem.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/iso19111/coordinatesystem.cpp b/src/iso19111/coordinatesystem.cpp index f96a962f..ef53dd57 100644 --- a/src/iso19111/coordinatesystem.cpp +++ b/src/iso19111/coordinatesystem.cpp @@ -410,7 +410,13 @@ void CoordinateSystemAxis::_exportToJSON( writer.Add(direction().toString()); writer.AddObjKey("unit"); - unit()._exportToJSON(formatter); + const auto &l_unit(unit()); + if (l_unit == common::UnitOfMeasure::METRE || + l_unit == common::UnitOfMeasure::DEGREE) { + writer.Add(l_unit.name()); + } else { + l_unit._exportToJSON(formatter); + } if (formatter->outputId()) { formatID(formatter); @@ -577,6 +583,7 @@ void CoordinateSystem::_exportToJSON( auto axisContext(writer.MakeArrayContext(false)); const auto &l_axisList = axisList(); for (auto &axis : l_axisList) { + formatter->setOmitTypeInImmediateChild(); axis->_exportToJSON(formatter); } |
