aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/coordinatesystem.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-02 13:28:57 +0100
committerGitHub <noreply@github.com>2020-01-02 13:28:57 +0100
commit1f8073ac6c82868e813a8ec8d05e403050e33c5e (patch)
treedb349195de4915f06a05e6133ecb5990732bea11 /src/iso19111/coordinatesystem.cpp
parent2da4b6f5027938cc1d3331351455bfdeabd40ad3 (diff)
parentea311993551f0019f38de361a5bc47fc630ee871 (diff)
downloadPROJ-1f8073ac6c82868e813a8ec8d05e403050e33c5e.tar.gz
PROJ-1f8073ac6c82868e813a8ec8d05e403050e33c5e.zip
Merge pull request #1820 from snowman2/cs_projjson
fix exporting CoordinateSystem to PROJ JSON with ID
Diffstat (limited to 'src/iso19111/coordinatesystem.cpp')
-rw-r--r--src/iso19111/coordinatesystem.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/iso19111/coordinatesystem.cpp b/src/iso19111/coordinatesystem.cpp
index 163f0f43..fc4b7492 100644
--- a/src/iso19111/coordinatesystem.cpp
+++ b/src/iso19111/coordinatesystem.cpp
@@ -581,11 +581,13 @@ void CoordinateSystem::_exportToJSON(
writer.Add(getWKT2Type(true));
writer.AddObjKey("axis");
- auto axisContext(writer.MakeArrayContext(false));
- const auto &l_axisList = axisList();
- for (auto &axis : l_axisList) {
- formatter->setOmitTypeInImmediateChild();
- axis->_exportToJSON(formatter);
+ {
+ auto axisContext(writer.MakeArrayContext(false));
+ const auto &l_axisList = axisList();
+ for (auto &axis : l_axisList) {
+ formatter->setOmitTypeInImmediateChild();
+ axis->_exportToJSON(formatter);
+ }
}
if (formatter->outputId()) {