diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-08 22:32:54 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-08 22:32:54 +0100 |
| commit | 9263e1d36eec53ee3c4e4d04da93a032c0596eec (patch) | |
| tree | 12afe91a09b60a9ae2a1b2fbff8fa81b24ceee41 /src/4D_api.cpp | |
| parent | da93fe3bea35ae8d2383e6006b7775bb96af6885 (diff) | |
| download | PROJ-9263e1d36eec53ee3c4e4d04da93a032c0596eec.tar.gz PROJ-9263e1d36eec53ee3c4e4d04da93a032c0596eec.zip | |
Add capability to read resource files from the user writable directory
Diffstat (limited to 'src/4D_api.cpp')
| -rw-r--r-- | src/4D_api.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp index cee8262e..9107723d 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -48,6 +48,7 @@ #include <math.h> #include "geodesic.h" #include "grids.hpp" +#include "filemanager.hpp" #include "proj/common.hpp" #include "proj/coordinateoperation.hpp" @@ -1450,6 +1451,16 @@ PJ_INFO proj_info (void) { /* build search path string */ auto ctx = pj_get_default_ctx(); if (!ctx || ctx->search_paths.empty()) { + // Env var mostly for testing purposes and being independent from + // an existing installation + const char* ignoreUserWritableDirectory = + getenv("PROJ_IGNORE_USER_WRITABLE_DIRECTORY"); + if( ignoreUserWritableDirectory == nullptr || + ignoreUserWritableDirectory[0] == '\0' ) { + buf = path_append(buf, + pj_context_get_user_writable_directory(ctx, false).c_str(), + &buf_size); + } const char *envPROJ_LIB = getenv("PROJ_LIB"); buf = path_append(buf, envPROJ_LIB, &buf_size); #ifdef PROJ_LIB |
