diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-18 18:42:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-18 18:42:31 +0200 |
| commit | 2357d264d477c5eee363514fb094772980509726 (patch) | |
| tree | c4bdcbe7d36d961a9a55241844fe1977d3434aad /src/apps | |
| parent | 3a2df3462c851b7dc823b1cd84fc8a61dc9c2d08 (diff) | |
| parent | ffe1922d54d4ce379c96f5472dba2e76223348f1 (diff) | |
| download | PROJ-2357d264d477c5eee363514fb094772980509726.tar.gz PROJ-2357d264d477c5eee363514fb094772980509726.zip | |
Merge pull request #2381 from rouault/fix_1453
Add multi-line PROJ string export capability, and use it by default in projinfo (unless --single-line is specified) (fixes #1543)
Diffstat (limited to 'src/apps')
| -rw-r--r-- | src/apps/projinfo.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 966de03d..ee48a69c 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -350,11 +350,11 @@ static void outputObject( objToExport = projStringExportable; } - std::cout << objToExport->exportToPROJString( - PROJStringFormatter::create( - PROJStringFormatter::Convention::PROJ_5, - dbContext) - .get()) + auto formatter = PROJStringFormatter::create( + PROJStringFormatter::Convention::PROJ_5, dbContext); + formatter->setMultiLine(!outputOpt.singleLine && + crs == nullptr); + std::cout << objToExport->exportToPROJString(formatter.get()) << std::endl; } catch (const std::exception &e) { std::cerr << "Error when exporting to PROJ string: " << e.what() @@ -376,9 +376,7 @@ static void outputObject( } auto formatter = WKTFormatter::create(WKTFormatter::Convention::WKT2_2015); - if (outputOpt.singleLine) { - formatter->setMultiLine(false); - } + formatter->setMultiLine(!outputOpt.singleLine); formatter->setStrict(outputOpt.strict); auto wkt = wktExportable->exportToWKT(formatter.get()); if (outputOpt.c_ify) { |
