diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2013-06-18 22:57:01 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2013-06-18 22:57:01 +0000 |
| commit | a12351d73508608107be0c846b377b567ea7a748 (patch) | |
| tree | 26b2956d6df832023781eb8d291c6d6331c6ae9a | |
| parent | 8d061d8042d3c74926af6e0edae7f64d287a617e (diff) | |
| download | PROJ-a12351d73508608107be0c846b377b567ea7a748.tar.gz PROJ-a12351d73508608107be0c846b377b567ea7a748.zip | |
rename and hide sign() function
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2338 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | src/PJ_healpix.c | 12 |
2 files changed, 11 insertions, 6 deletions
@@ -1,3 +1,8 @@ +2013-06-18 Frank Warmerdam <warmerdam@google.com> + + * src/PJ_healpix.c: rename sign() to pj_sign() and make it static. No + need to risk conflicting with sign() in other packages like gctpc. + 2012-12-17 Frank Warmerdam <warmerdam@pobox.com> * src/pj_init.c: Recover gracefully if setlocale() returns NULL diff --git a/src/PJ_healpix.c b/src/PJ_healpix.c index 30f3a5a1..d775b81f 100644 --- a/src/PJ_healpix.c +++ b/src/PJ_healpix.c @@ -68,7 +68,7 @@ double rot[7][2][2] = ROT; /** NOTES: Alex Raichev implemented the math in python and this is a port of his work. The healpix projection is a Lambert cylindrical equal-area projection for - equaltorial latitudes and an interrupted Colignon projection for polar + equaltorial latitudes and an interrupted Colignon projection for polar latitudes. **/ @@ -77,7 +77,7 @@ double rot[7][2][2] = ROT; * @param v the parameter whose sign is returned. * @return 1 for positive number, -1 for negative, and 0 for zero. **/ -double sign (double v) { +static double pj_sign (double v) { return v > 0 ? 1 : (v < 0 ? -1 : 0); } /** @@ -286,7 +286,7 @@ double auth_lat(double phi, double e, int inverse){ double ratio = q/qp; // Rounding errors if( fabsl(ratio) > 1){ - ratio = sign(ratio); + ratio = pj_sign(ratio); } return asin(ratio); } @@ -316,7 +316,7 @@ XY healpix_sphere(LP lp, PJ *P){ } lamc = -3*PI/4 + (PI/2)*cn; xy.x = lamc + (lam - lamc) * sigma; - xy.y = sign(phi)*PI/4 * (2 - sigma); + xy.y = pj_sign(phi)*PI/4 * (2 - sigma); } xy.x = scale_number(xy.x,P->a,0); xy.y = scale_number(xy.y,P->a,0); @@ -348,10 +348,10 @@ LP healpix_sphere_inv(XY xy, PJ *P){ xc = -3.0 * PI/4.0 + (PI/2.0)*cn; tau = 2.0 - 4.0*fabsl(y)/PI; lp.lam = xc + (x - xc)/tau; - lp.phi = sign(y)*asin(1.0 - pow(tau , 2.0)/3.0); + lp.phi = pj_sign(y)*asin(1.0 - pow(tau , 2.0)/3.0); } else { lp.lam = -1.0*PI - P->lam0; - lp.phi = sign(y)*PI/2.0; + lp.phi = pj_sign(y)*PI/2.0; } return (lp); } |
