From b4f02cf97e634550be6994f4d0f13b82d57abcd7 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Mon, 1 May 2006 21:13:54 +0000 Subject: make out of range errors in geodetic to geocentric a transient error git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1335 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- src/pj_transform.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pj_transform.c b/src/pj_transform.c index b41d241f..087d7fb1 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -30,6 +30,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.18 2006/05/01 21:13:54 fwarmerdam + * make out of range errors in geodetic to geocentric a transient error + * * Revision 1.17 2006/03/20 17:54:34 fwarmerdam * pj_geodetic_to_geocentric returns -14 now for lat out of range * @@ -342,6 +345,8 @@ int pj_geodetic_to_geocentric( double a, double es, double b; int i; + pj_errno = 0; + if( es == 0.0 ) b = a; else @@ -364,11 +369,12 @@ int pj_geodetic_to_geocentric( double a, double es, x+io, y+io, z+io ) != 0 ) { pj_errno = -14; - return -14; + x[io] = y[io] = HUGE_VAL; + /* but keep processing points! */ } } - return 0; + return pj_errno; } /************************************************************************/ @@ -591,7 +597,7 @@ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, z_is_temp = TRUE; } -#define CHECK_RETURN {if( pj_errno != 0 ) { if( z_is_temp ) pj_dalloc(z); return pj_errno; }} +#define CHECK_RETURN {if( pj_errno != 0 && (pj_errno > 0 || transient_error[-pj_errno] == 0) ) { if( z_is_temp ) pj_dalloc(z); return pj_errno; }} /* -------------------------------------------------------------------- */ /* If this datum requires grid shifts, then apply it to geodetic */ -- cgit v1.2.3