diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-13 11:46:08 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-15 16:16:31 +0100 |
| commit | 8a67a3fb96ffdb29887b2954dd4bb8af92f6960d (patch) | |
| tree | 11b712b6c4df671ae37377e66541939fef4ce799 /src/apps/projinfo.cpp | |
| parent | e33f6b5eccdb0c66f5ff81c07a619708ebf9ec31 (diff) | |
| download | PROJ-8a67a3fb96ffdb29887b2954dd4bb8af92f6960d.tar.gz PROJ-8a67a3fb96ffdb29887b2954dd4bb8af92f6960d.zip | |
SQL output: add capability to restrict the authorities into which to look for intermediate objects
Diffstat (limited to 'src/apps/projinfo.cpp')
| -rw-r--r-- | src/apps/projinfo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 39d9666d..2334c293 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -76,6 +76,7 @@ struct OutputOptions { bool allowEllipsoidalHeightAsVerticalCRS = false; std::string outputAuthName{}; std::string outputCode{}; + std::vector<std::string> allowedAuthorities{}; }; } // anonymous namespace @@ -104,6 +105,7 @@ static void usage() { << " [--allow-ellipsoidal-height-as-vertical-crs]" << std::endl << " [--boundcrs-to-wgs84]" << std::endl + << " [--authority name]" << std::endl << " [--main-db-path path] [--aux-db-path path]*" << std::endl << " [--identify] [--3d]" << std::endl @@ -573,9 +575,14 @@ static void outputObject( std::cout << "SQL:" << std::endl; } dbContext->startInsertStatementsSession(); + auto allowedAuthorities(outputOpt.allowedAuthorities); + if (allowedAuthorities.empty()) { + allowedAuthorities.emplace_back("EPSG"); + allowedAuthorities.emplace_back("PROJ"); + } const auto statements = dbContext->getInsertStatementsFor( NN_NO_CHECK(identified), outputOpt.outputAuthName, - outputOpt.outputCode, false); + outputOpt.outputCode, false, allowedAuthorities); dbContext->stopInsertStatementsSession(); for (const auto &sql : statements) { std::cout << sql << std::endl; @@ -1118,6 +1125,7 @@ int main(int argc, char **argv) { } else if (arg == "--authority" && i + 1 < argc) { i++; authority = argv[i]; + outputOpt.allowedAuthorities = split(authority, ','); } else if (arg == "--identify") { identify = true; } else if (arg == "--show-superseded") { |
