diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 12:59:49 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 14:42:39 +0200 |
| commit | 81bd57dfd8cfae609288643d1b09a4805f1bcded (patch) | |
| tree | 947f9093cdc8043d9cd822bb828407d2f82dc28d /src/apps/projinfo.cpp | |
| parent | 89f2cc7ec4178a369e73e9cd115a2552a55d870a (diff) | |
| download | PROJ-81bd57dfd8cfae609288643d1b09a4805f1bcded.tar.gz PROJ-81bd57dfd8cfae609288643d1b09a4805f1bcded.zip | |
createFromUserInput(): add capability to import PROJJSON
Diffstat (limited to 'src/apps/projinfo.cpp')
| -rw-r--r-- | src/apps/projinfo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 6cacdd66..8f3f09b8 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -482,10 +482,12 @@ static void outputObject( if (!outputOpt.quiet) { std::cout << "PROJJSON:" << std::endl; } - - std::cout << JSONExportable->exportToJSON( - JSONFormatter::create(dbContext).get()) - << std::endl; + auto jsonString(JSONExportable->exportToJSON( + JSONFormatter::create(dbContext).get())); + if (outputOpt.c_ify) { + jsonString = c_ify_string(jsonString); + } + std::cout << jsonString << std::endl; } catch (const std::exception &e) { std::cerr << "Error when exporting to PROJJSON: " << e.what() << std::endl; |
