aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2003-03-20 21:29:41 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2003-03-20 21:29:41 +0000
commit7fedcbb621e08d8c65e294170be3935e081bdf3f (patch)
tree9cdaea3636ed7137b760c7c911fea4f1d6cb6673 /src
parent6919083dc614289a80692e80361637c08d1b188d (diff)
downloadPROJ-7fedcbb621e08d8c65e294170be3935e081bdf3f.tar.gz
PROJ-7fedcbb621e08d8c65e294170be3935e081bdf3f.zip
Fixed bug in checking against grid bounds.
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1116 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
-rw-r--r--src/pj_apply_gridshift.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c
index 19eb5954..1fc72dae 100644
--- a/src/pj_apply_gridshift.c
+++ b/src/pj_apply_gridshift.c
@@ -31,6 +31,9 @@
******************************************************************************
*
* $Log$
+ * Revision 1.8 2003/03/20 21:29:41 warmerda
+ * Fixed bug in checking against grid bounds.
+ *
* Revision 1.7 2003/03/17 19:45:23 warmerda
* improved error handling
*
@@ -100,8 +103,8 @@ int pj_apply_gridshift( const char *nadgrids, int inverse,
/* skip tables that don't match our point at all. */
if( ct->ll.phi > input.phi || ct->ll.lam > input.lam
- || ct->ll.phi + ct->lim.phi * ct->del.phi < input.phi
- || ct->ll.lam + ct->lim.lam * ct->del.lam < input.lam )
+ || ct->ll.phi + (ct->lim.phi-1) * ct->del.phi < input.phi
+ || ct->ll.lam + (ct->lim.lam-1) * ct->del.lam < input.lam )
continue;
/* If we have child nodes, check to see if any of them apply. */
@@ -114,8 +117,8 @@ int pj_apply_gridshift( const char *nadgrids, int inverse,
struct CTABLE *ct1 = child->ct;
if( ct1->ll.phi > input.phi || ct1->ll.lam > input.lam
- || ct1->ll.phi + ct1->lim.phi*ct1->del.phi < input.phi
- || ct1->ll.lam + ct1->lim.lam*ct1->del.lam < input.lam)
+ || ct1->ll.phi+(ct1->lim.phi-1)*ct1->del.phi < input.phi
+ || ct1->ll.lam+(ct1->lim.lam-1)*ct1->del.lam < input.lam)
continue;
break;