diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-06-11 01:51:24 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-06-11 01:51:24 +0000 |
| commit | ec678c07c2acb83da8a2187c541b8a2e452dec4b (patch) | |
| tree | a4c004a6e88d7330fe9d1c6ed793129831b5bdca /src/pj_fwd.c | |
| parent | a7290836114dc82b35eceb1efcb5ecdf605d335f (diff) | |
| download | PROJ-ec678c07c2acb83da8a2187c541b8a2e452dec4b.tar.gz PROJ-ec678c07c2acb83da8a2187c541b8a2e452dec4b.zip | |
preliminary implementation of projCtx API
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1854 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_fwd.c')
| -rw-r--r-- | src/pj_fwd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pj_fwd.c b/src/pj_fwd.c index 880a9319..b70b4240 100644 --- a/src/pj_fwd.c +++ b/src/pj_fwd.c @@ -11,9 +11,12 @@ pj_fwd(LP lp, PJ *P) { /* check for forward and latitude or longitude overange */ if ((t = fabs(lp.phi)-HALFPI) > EPS || fabs(lp.lam) > 10.) { xy.x = xy.y = HUGE_VAL; - pj_errno = -14; + pj_ctx_set_errno( P->ctx, -14); } else { /* proceed with projection */ - errno = pj_errno = 0; + P->ctx->last_errno = 0; + pj_errno = 0; + errno = 0; + if (fabs(t) <= EPS) lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; else if (P->geoc) @@ -22,7 +25,7 @@ pj_fwd(LP lp, PJ *P) { if (!P->over) lp.lam = adjlon(lp.lam); /* adjust del longitude */ xy = (*P->fwd)(lp, P); /* project */ - if (pj_errno || (pj_errno = errno)) + if ( P->ctx->last_errno ) xy.x = xy.y = HUGE_VAL; /* adjust for major axis and easting/northings */ else { |
