From 02ac4443cda9b474db4b4f2d60d21dad9561611b Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Thu, 9 Feb 2012 04:24:45 +0000 Subject: do not let one point falling out of the datum shift grid area to cause the remainder to not be transformed (#45) git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2153 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- ChangeLog | 6 ++++++ src/pj_apply_gridshift.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9cd9aa75..45ccf2ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-02-08 Frank Warmerdam + + * 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 * 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 { -- cgit v1.2.3