aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-01-17 17:01:20 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-01-17 21:57:27 +0100
commitc0ac895d77e823fe9a9458d013eb0f6378f39060 (patch)
tree9e7641cda61a75c3a6209d17dad6fa7c8448cd44 /src/init.cpp
parent3121d9bc309b439adcc2ab9743a3d2b3a8f48296 (diff)
downloadPROJ-c0ac895d77e823fe9a9458d013eb0f6378f39060.tar.gz
PROJ-c0ac895d77e823fe9a9458d013eb0f6378f39060.zip
Remove proj_create_from_proj_string() and proj_create_from_user_input(), and make proj_create() do more or less what proj_create_from_user_input() did before (fixes #1214)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 2ed34a09..8af3d26c 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -238,6 +238,10 @@ Expand key from buffer or (if not in buffer) from init file
char *definition = nullptr;
paralist *init_items = nullptr;
+ if( !ctx ) {
+ ctx = pj_get_default_ctx();
+ }
+
/* support "init=file:section", "+init=file:section", and "file:section" format */
xkey = strstr (key, "init=");
if (nullptr==xkey)
@@ -270,7 +274,6 @@ Expand key from buffer or (if not in buffer) from init file
}
if( !exists ) {
- const char* const optionsProj4Mode[] = { "USE_PROJ4_INIT_RULES=YES", nullptr };
char szInitStr[7 + 64];
PJ* src;
const char* proj_string;
@@ -287,7 +290,10 @@ Expand key from buffer or (if not in buffer) from init file
strcpy(szInitStr, "+init=");
strcat(szInitStr, xkey);
- src = proj_create_from_user_input(ctx, szInitStr, optionsProj4Mode);
+ auto old_proj4_init_rules = ctx->use_proj4_init_rules;
+ ctx->use_proj4_init_rules = true;
+ src = proj_create(ctx, szInitStr);
+ ctx->use_proj4_init_rules = old_proj4_init_rules;
if( !src ) {
return nullptr;
}