diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-15 15:37:44 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-15 16:16:32 +0100 |
| commit | 72f4f49bf3a2f95e4c2f4571205aa0925f20449a (patch) | |
| tree | 409d2ed5356c2f70c4ca2414f9197ad1b63d0f8d /src/ctx.cpp | |
| parent | eda2311513a67d274d67f5ae8fb3042d78fe3b96 (diff) | |
| download | PROJ-72f4f49bf3a2f95e4c2f4571205aa0925f20449a.tar.gz PROJ-72f4f49bf3a2f95e4c2f4571205aa0925f20449a.zip | |
Add support for PROJ_AUX_DB environment variable to set the path to one or several auxiliary DBs
Diffstat (limited to 'src/ctx.cpp')
| -rw-r--r-- | src/ctx.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp index 097633ae..cc9df6c3 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -91,13 +91,16 @@ pj_ctx pj_ctx::createDefault() ctx.logger = pj_stderr_logger; NS_PROJ::FileManager::fillDefaultNetworkInterface(&ctx); - if( getenv("PROJ_DEBUG") != nullptr ) + const char* projDebug = getenv("PROJ_DEBUG"); + if( projDebug != nullptr ) { - if( atoi(getenv("PROJ_DEBUG")) >= -PJ_LOG_TRACE ) - ctx.debug_level = atoi(getenv("PROJ_DEBUG")); + const int debugLevel = atoi(projDebug); + if( debugLevel >= -PJ_LOG_TRACE ) + ctx.debug_level = debugLevel; else ctx.debug_level = PJ_LOG_TRACE; } + return ctx; } |
