diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-01-18 07:10:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-18 07:10:42 +0100 |
| commit | 8584dcd50777355b460b38418cae0db05dcf91bc (patch) | |
| tree | b7335182c91737ceda8518a638ac5a79bd2bc5b2 /src/init.cpp | |
| parent | 3fc48e6146e020b86a0ef87749cc645f9b4fa113 (diff) | |
| parent | 25f8ad123dc5fb7de0ac2fb10b55ae9efd2723a3 (diff) | |
| download | PROJ-8584dcd50777355b460b38418cae0db05dcf91bc.tar.gz PROJ-8584dcd50777355b460b38418cae0db05dcf91bc.zip | |
Merge pull request #1223 from rouault/unify_proj_create
Unify proj_create(), proj_create_from_user_input() and proj_create_from_proj_string() (fixes #1214)
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 10 |
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; } |
