diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-01-24 22:53:33 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-01-24 22:53:33 +0000 |
| commit | e525ab9ff2adcf195fc7eea173f2fce45f7fd8f5 (patch) | |
| tree | 3635d149744efd70df66cc2a83c032149169be83 /src/pj_transform.c | |
| parent | a32477f71af5103697a0441eaecb74537e2211db (diff) | |
| download | PROJ-e525ab9ff2adcf195fc7eea173f2fce45f7fd8f5.tar.gz PROJ-e525ab9ff2adcf195fc7eea173f2fce45f7fd8f5.zip | |
fix seriously broken lon_wrap support (#62)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1789 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_transform.c')
| -rw-r--r-- | src/pj_transform.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c index 07b84f80..c64b410f 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -268,17 +268,17 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, /* If a wrapping center other than 0 is provided, rewrap around */ /* the suggested center (for latlong coordinate systems only). */ /* -------------------------------------------------------------------- */ - else if( dstdefn->is_latlong && dstdefn->long_wrap_center != 0 ) + else if( dstdefn->is_latlong && dstdefn->is_long_wrap_set ) { for( i = 0; i < point_count; i++ ) { if( x[point_offset*i] == HUGE_VAL ) continue; - while( x[point_offset*i] < dstdefn->long_wrap_center - HALFPI ) - x[point_offset*i] += PI; - while( x[point_offset*i] > dstdefn->long_wrap_center + HALFPI ) - x[point_offset*i] -= PI; + while( x[point_offset*i] < dstdefn->long_wrap_center - PI ) + x[point_offset*i] += TWOPI; + while( x[point_offset*i] > dstdefn->long_wrap_center + PI ) + x[point_offset*i] -= TWOPI; } } |
