aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pj_factors.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pj_factors.c b/src/pj_factors.c
index 69d59e49..3c2e97cb 100644
--- a/src/pj_factors.c
+++ b/src/pj_factors.c
@@ -14,6 +14,8 @@
int pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {
double cosphi, t, n, r;
int err;
+ PJ_COORD coo = {{0, 0, 0, 0}};
+ coo.lp = lp;
err = proj_errno_reset (P);
@@ -38,7 +40,7 @@ int pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) {
/* If input latitudes are geocentric, convert to geographic */
if (P->geoc)
- lp.phi = atan(P->rone_es * tan(lp.phi));
+ lp = proj_geoc_lat (P, PJ_INV, coo).lp;
/* If latitude + one step overshoots the pole, move it slightly inside, */
/* so the numerical derivative still exists */