aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/metadata.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-04-23 19:15:22 +0200
committerGitHub <noreply@github.com>2020-04-23 19:15:22 +0200
commitb0e5448982b4e12db9a664ac96089a14375cb55d (patch)
tree7875e6eb0d25185d23f06b02c56b9e827d0a6825 /src/iso19111/metadata.cpp
parentf5f0efe5eb6b76cfe0498835da268c2492f3fe58 (diff)
downloadPROJ-b0e5448982b4e12db9a664ac96089a14375cb55d.tar.gz
PROJ-b0e5448982b4e12db9a664ac96089a14375cb55d.zip
io.hpp: avoid dependency to proj_json_streaming_writer.hpp (fixes #2182) (#2183)
Diffstat (limited to 'src/iso19111/metadata.cpp')
-rw-r--r--src/iso19111/metadata.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/iso19111/metadata.cpp b/src/iso19111/metadata.cpp
index 6266a86d..8f2601e0 100644
--- a/src/iso19111/metadata.cpp
+++ b/src/iso19111/metadata.cpp
@@ -38,6 +38,8 @@
#include "proj/internal/internal.hpp"
#include "proj/internal/io_internal.hpp"
+#include "proj_json_streaming_writer.hpp"
+
#include <algorithm>
#include <memory>
#include <string>
@@ -1102,15 +1104,15 @@ void Identifier::_exportToJSON(JSONFormatter *formatter) const {
const std::string &l_code = code();
const std::string &l_codeSpace = *codeSpace();
if (!l_codeSpace.empty() && !l_code.empty()) {
- auto &writer = formatter->writer();
+ auto writer = formatter->writer();
auto objContext(formatter->MakeObjectContext(nullptr, false));
- writer.AddObjKey("authority");
- writer.Add(l_codeSpace);
- writer.AddObjKey("code");
+ writer->AddObjKey("authority");
+ writer->Add(l_codeSpace);
+ writer->AddObjKey("code");
try {
- writer.Add(std::stoi(l_code));
+ writer->Add(std::stoi(l_code));
} catch (const std::exception &) {
- writer.Add(l_code);
+ writer->Add(l_code);
}
}
}