aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2012-02-09 04:24:45 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2012-02-09 04:24:45 +0000
commit02ac4443cda9b474db4b4f2d60d21dad9561611b (patch)
treeef443517aa49bed366fbb12d022785ea34c4d27a /src
parentfaffa62c5414cf9d97e3d7d889ffa60657135129 (diff)
downloadPROJ-02ac4443cda9b474db4b4f2d60d21dad9561611b.tar.gz
PROJ-02ac4443cda9b474db4b4f2d60d21dad9561611b.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/pj_apply_gridshift.c20
1 files changed, 17 insertions, 3 deletions
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
{