From 81bd57dfd8cfae609288643d1b09a4805f1bcded Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 9 Aug 2019 12:59:49 +0200 Subject: createFromUserInput(): add capability to import PROJJSON --- src/apps/projinfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/apps/projinfo.cpp') 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; -- cgit v1.2.3