aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan D. Snow <alansnow21@gmail.com>2020-08-20 10:48:40 -0500
committerGitHub <noreply@github.com>2020-08-20 17:48:40 +0200
commitbc1dcf2cd581a5c144a9c35028bd33aa9191882f (patch)
treefede8e9f75fe796ab51c624ade530938bd28a6e2 /src
parent2b3475c853b37b1485e92ef8cf78b02fb0db6142 (diff)
downloadPROJ-bc1dcf2cd581a5c144a9c35028bd33aa9191882f.tar.gz
PROJ-bc1dcf2cd581a5c144a9c35028bd33aa9191882f.zip
projCtx_t: Copy ini file settings, proj4_init_rules, etc.. when initializing context from global (#2331)
Diffstat (limited to 'src')
-rw-r--r--src/ctx.cpp36
-rw-r--r--src/proj_internal.h11
2 files changed, 28 insertions, 19 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index c2b30644..5575d3aa 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -167,22 +167,30 @@ void projCtx_t::set_ca_bundle_path(const std::string& ca_bundle_path_in)
/* projCtx_t(const projCtx_t& other) */
/************************************************************************/
-projCtx_t::projCtx_t(const projCtx_t& other)
+projCtx_t::projCtx_t(const projCtx_t& other) :
+ debug_level(other.debug_level),
+ logger(other.logger),
+ logger_app_data(other.logger_app_data),
+ fileapi_legacy(other.fileapi_legacy),
+ cpp_context(other.cpp_context ? other.cpp_context->clone(this) : nullptr),
+ use_proj4_init_rules(other.use_proj4_init_rules),
+ epsg_file_exists(other.epsg_file_exists),
+ ca_bundle_path(other.ca_bundle_path),
+ env_var_proj_lib(other.env_var_proj_lib),
+ file_finder_legacy(other.file_finder_legacy),
+ file_finder(other.file_finder),
+ file_finder_user_data(other.file_finder_user_data),
+ custom_sqlite3_vfs_name(other.custom_sqlite3_vfs_name),
+ user_writable_directory(other.user_writable_directory),
+ // BEGIN ini file settings
+ iniFileLoaded(other.iniFileLoaded),
+ endpoint(other.endpoint),
+ networking(other.networking),
+ gridChunkCache(other.gridChunkCache),
+ defaultTmercAlgo(other.defaultTmercAlgo)
+ // END ini file settings
{
- debug_level = other.debug_level;
- logger = other.logger;
- logger_app_data = other.logger_app_data;
- fileapi_legacy = other.fileapi_legacy;
- epsg_file_exists = other.epsg_file_exists;
set_search_paths(other.search_paths);
- file_finder = other.file_finder;
- file_finder_legacy = other.file_finder_legacy;
- file_finder_user_data = other.file_finder_user_data;
- networking = other.networking;
- ca_bundle_path = other.ca_bundle_path;
- if (other.cpp_context != nullptr) {
- cpp_context = other.cpp_context->clone(this);
- }
}
/************************************************************************/
diff --git a/src/proj_internal.h b/src/proj_internal.h
index 01da337b..79b1da10 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -735,22 +735,23 @@ struct projCtx_t {
const char* (*file_finder) (PJ_CONTEXT *, const char*, void* user_data) = nullptr;
void* file_finder_user_data = nullptr;
- projNetworkCallbacksAndData networking{};
- bool defer_grid_opening = false; // set by pj_obj_create()
+ bool defer_grid_opening = false; // set transiently by pj_obj_create()
projFileApiCallbackAndData fileApi{};
std::string custom_sqlite3_vfs_name{};
+ std::string user_writable_directory{};
+ // BEGIN ini file settings
bool iniFileLoaded = false;
std::string endpoint{};
-
- std::string user_writable_directory{};
+ projNetworkCallbacksAndData networking{};
projGridChunkCache gridChunkCache{};
+ TMercAlgo defaultTmercAlgo = TMercAlgo::PODER_ENGSAGER; // can be overridden by content of proj.ini
+ // END ini file settings
int projStringParserCreateFromPROJStringRecursionCounter = 0; // to avoid potential infinite recursion in PROJStringParser::createFromPROJString()
int pipelineInitRecursiongCounter = 0; // to avoid potential infinite recursion in pipeline.cpp
- TMercAlgo defaultTmercAlgo = TMercAlgo::PODER_ENGSAGER; // can be overridden by content of proj.ini
projCtx_t() = default;
projCtx_t(const projCtx_t&);