Skip to content

Commit faa05f6

Browse files
committed
merge from pyproj svn
1 parent 20a9d20 commit faa05f6

7 files changed

+2145
-1395
lines changed

src/PJ_healpix.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ double rot[7][2][2] = ROT;
6868
/**
6969
NOTES: Alex Raichev implemented the math in python and this is a port of his work.
7070
The healpix projection is a Lambert cylindrical equal-area projection for
71-
equaltorial latitudes and an interrupted Colignon projection for polar
71+
equaltorial latitudes and an interrupted Colignon projection for polar
7272
latitudes.
7373
**/
7474

@@ -77,7 +77,7 @@ double rot[7][2][2] = ROT;
7777
* @param v the parameter whose sign is returned.
7878
* @return 1 for positive number, -1 for negative, and 0 for zero.
7979
**/
80-
double sign (double v) {
80+
static double pj_sign (double v) {
8181
return v > 0 ? 1 : (v < 0 ? -1 : 0);
8282
}
8383
/**
@@ -286,7 +286,7 @@ double auth_lat(double phi, double e, int inverse){
286286
double ratio = q/qp;
287287
// Rounding errors
288288
if( fabsl(ratio) > 1){
289-
ratio = sign(ratio);
289+
ratio = pj_sign(ratio);
290290
}
291291
return asin(ratio);
292292
}
@@ -316,7 +316,7 @@ XY healpix_sphere(LP lp, PJ *P){
316316
}
317317
lamc = -3*PI/4 + (PI/2)*cn;
318318
xy.x = lamc + (lam - lamc) * sigma;
319-
xy.y = sign(phi)*PI/4 * (2 - sigma);
319+
xy.y = pj_sign(phi)*PI/4 * (2 - sigma);
320320
}
321321
xy.x = scale_number(xy.x,P->a,0);
322322
xy.y = scale_number(xy.y,P->a,0);
@@ -348,10 +348,10 @@ LP healpix_sphere_inv(XY xy, PJ *P){
348348
xc = -3.0 * PI/4.0 + (PI/2.0)*cn;
349349
tau = 2.0 - 4.0*fabsl(y)/PI;
350350
lp.lam = xc + (x - xc)/tau;
351-
lp.phi = sign(y)*asin(1.0 - pow(tau , 2.0)/3.0);
351+
lp.phi = pj_sign(y)*asin(1.0 - pow(tau , 2.0)/3.0);
352352
} else {
353353
lp.lam = -1.0*PI - P->lam0;
354-
lp.phi = sign(y)*PI/2.0;
354+
lp.phi = pj_sign(y)*PI/2.0;
355355
}
356356
return (lp);
357357
}

0 commit comments

Comments
 (0)