From c0ac895d77e823fe9a9458d013eb0f6378f39060 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 17 Jan 2019 17:01:20 +0100 Subject: 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) --- src/init.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/init.cpp') 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; } -- cgit v1.2.3