aboutsummaryrefslogtreecommitdiff
path: root/src/ctx.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-03-18 14:49:13 +0100
committerGitHub <noreply@github.com>2021-03-18 14:49:13 +0100
commitd4e5e1a833fa37afb5829d9eb9bfbe1472425df4 (patch)
tree1042dd9a9a6934b39a766c3b219ade22b9dd15c7 /src/ctx.cpp
parent979e3a3ba0b270f7401a57105411375bb99ddbb5 (diff)
parenteae06c94dba10640ca2d669c4e7b356a1613f9f3 (diff)
downloadPROJ-d4e5e1a833fa37afb5829d9eb9bfbe1472425df4.tar.gz
PROJ-d4e5e1a833fa37afb5829d9eb9bfbe1472425df4.zip
Merge pull request #2577 from rouault/insert_sql
Add capability to get SQL statements to add custom CRS in the database
Diffstat (limited to 'src/ctx.cpp')
-rw-r--r--src/ctx.cpp9
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;
}