Skip to content

Commit 1b14212

Browse files
committed
pj_hgrid_apply_internal(): use pj_log() infrastructure
1 parent 6d10acf commit 1b14212

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/grids.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,19 +3462,19 @@ static PJ_LP pj_hgrid_apply_internal(PJ_CONTEXT *ctx, PJ_LP in,
34623462
toltol)); /* prob. slightly faster than hypot() */
34633463

34643464
if (i == 0) {
3465-
/* If we had access to a context, this should go through pj_log, and we
3466-
* should set ctx->errno */
3467-
if (getenv("PROJ_DEBUG"))
3468-
fprintf(stderr,
3469-
"Inverse grid shift iterator failed to converge.\n");
3465+
pj_log(ctx, PJ_LOG_TRACE,
3466+
"Inverse grid shift iterator failed to converge.\n");
3467+
proj_context_errno_set(ctx, PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID);
34703468
t.lam = t.phi = HUGE_VAL;
34713469
return t;
34723470
}
34733471

34743472
/* and again: pj_log and ctx->errno */
3475-
if (del.lam == HUGE_VAL && getenv("PROJ_DEBUG"))
3476-
fprintf(stderr, "Inverse grid shift iteration failed, presumably at "
3477-
"grid edge.\nUsing first approximation.\n");
3473+
if (del.lam == HUGE_VAL) {
3474+
pj_log(ctx, PJ_LOG_TRACE,
3475+
"Inverse grid shift iteration failed, presumably at "
3476+
"grid edge.\nUsing first approximation.\n");
3477+
}
34783478

34793479
in.lam = adjlon(t.lam + extent->west);
34803480
in.phi = t.phi + extent->south;

0 commit comments

Comments
 (0)