diff options
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | src/pj_apply_gridshift.c | 20 |
2 files changed, 23 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2012-02-08 Frank Warmerdam <warmerdam@pobox.com> + + * src/pj_apply_gridshift.c: Ensure that one amoung many points + falling outside the grid areas will not cause the remainder to not + be datum shifted in a way that is hard to diagnose. (#45) + 2012-02-01 Frank Warmerdam <warmerdam@pobox.com> * src/pj_apply_gridshift.c: ensure we try to use grids as long as we diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c index 366026db..c231f77e 100644 --- a/src/pj_apply_gridshift.c +++ b/src/pj_apply_gridshift.c @@ -218,9 +218,23 @@ int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **tables, int grid_count, ",%s", gi->gridname ); } } - - pj_ctx_set_errno( ctx, PJD_ERR_GRID_AREA ); - return PJD_ERR_GRID_AREA; + + /* + * We don't actually have any machinery currently to set the following + * macro, so this is mostly kept here to make it clear how we ought to + * operate if we wanted to make it super clear that an error has occured + * when points are outside our available datum shift areas. But if this + * is on, we will find that "low value" points on the fringes of some + * datasets will completely fail causing lots of problems when it is more + * or less ok to just not apply a datum shift. So rather than deal with + * that we just fallback to no shift. (see also bug #45). + */ +#ifdef ERR_GRID_AREA_TRANSIENT_SEVERE + y[io] = HUGE_VAL; + x[io] = HUGE_VAL; +#else + /* leave x/y unshifted. */ +#endif } else { |
