From 82cbab19db5ec8fd7b2fec7f6faf75993381f105 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Sat, 10 Feb 2018 12:00:15 +0100 Subject: pj_init: set ellipsoid if given, even if not needed --- src/pj_init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pj_init.c b/src/pj_init.c index 0acc6c71..f54a2a92 100644 --- a/src/pj_init.c +++ b/src/pj_init.c @@ -593,12 +593,12 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) { if (pj_datum_set(ctx, start, PIN)) return pj_default_destructor (PIN, proj_errno(PIN)); - if (PIN->need_ellps) { - int ret = pj_ellipsoid (PIN); - if (0 != ret) { - pj_log (ctx, PJ_LOG_DEBUG_MINOR, "pj_init_ctx: Must specify ellipsoid or sphere"); - return pj_default_destructor (PIN, proj_errno(PIN)); - } + err = pj_ellipsoid (PIN); + if (PIN->need_ellps && 0 != err) { + pj_log (ctx, PJ_LOG_DEBUG_MINOR, "pj_init_ctx: Must specify ellipsoid or sphere"); + return pj_default_destructor (PIN, proj_errno(PIN)); + } + if (0==err) { PIN->a_orig = PIN->a; PIN->es_orig = PIN->es; if (pj_calc_ellipsoid_params (PIN, PIN->a, PIN->es)) -- cgit v1.2.3