aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/coordinatesystem.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-08-08 20:04:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-08-09 13:22:25 +0200
commit89f2cc7ec4178a369e73e9cd115a2552a55d870a (patch)
treeb5a96d4248a0bb866477ed3c865fdb5648dc0a06 /src/iso19111/coordinatesystem.cpp
parentec49c9cd0aa9de24623920b8de226daf05a0e90f (diff)
downloadPROJ-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.cpp9
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);
}