diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-16 12:44:36 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-16 12:44:36 +0000 |
| commit | e4f028223c773d3d60c6e59e00653ff22e538c90 (patch) | |
| tree | ccb372db2f83167ac006f34c5a9892ef645d4669 /src/pj_transform.c | |
| parent | 4ea16fcba0dd2e67c62488beeaddf8a93b49fdf7 (diff) | |
| download | PROJ-e4f028223c773d3d60c6e59e00653ff22e538c90.tar.gz PROJ-e4f028223c773d3d60c6e59e00653ff22e538c90.zip | |
Rework the translation of nadgrids parameters into a list of gridshift files
to avoid use of static "lastnadgrids" information which screws up
multithreading. Changes the PJ structure.
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1831 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_transform.c')
| -rw-r--r-- | src/pj_transform.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c index eaf060eb..94f7d6ed 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -89,6 +89,7 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, { long i; + int err; pj_errno = 0; @@ -132,10 +133,11 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, } } - if( pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig, - point_count, point_offset, - x, y, z ) != 0) - return pj_errno; + err = pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig, + point_count, point_offset, + x, y, z ); + if( err != 0 ) + return err; } /* -------------------------------------------------------------------- */ @@ -152,7 +154,7 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, fprintf( stderr, "pj_transform(): source projection not invertable\n" ); } - return pj_errno; + return -17; } for( i = 0; i < point_count; i++ ) @@ -604,8 +606,7 @@ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, /* -------------------------------------------------------------------- */ if( srcdefn->datum_type == PJD_GRIDSHIFT ) { - pj_apply_gridshift( pj_param(srcdefn->params,"snadgrids").s, 0, - point_count, point_offset, x, y, z ); + pj_apply_gridshift_2( srcdefn, 0, point_count, point_offset, x, y, z ); CHECK_RETURN; src_a = SRS_WGS84_SEMIMAJOR; @@ -664,8 +665,7 @@ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, /* -------------------------------------------------------------------- */ if( dstdefn->datum_type == PJD_GRIDSHIFT ) { - pj_apply_gridshift( pj_param(dstdefn->params,"snadgrids").s, 1, - point_count, point_offset, x, y, z ); + pj_apply_gridshift_2( dstdefn, 1, point_count, point_offset, x, y, z ); CHECK_RETURN; } |
