diff options
| -rw-r--r-- | src/pj_ell_set.c | 5 | ||||
| -rw-r--r-- | test/gie/ellipsoid.gie | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/pj_ell_set.c b/src/pj_ell_set.c index 6c89ea0d..e2d2750c 100644 --- a/src/pj_ell_set.c +++ b/src/pj_ell_set.c @@ -258,9 +258,8 @@ static int ellps_shape (PJ *P) { P->f = pj_atof (pj_param_value (par)); if (HUGE_VAL==P->f) return proj_errno_set (P, PJD_ERR_INVALID_ARG); - if (0==P->f) - return proj_errno_set (P, PJD_ERR_INVALID_ARG); - P->rf = 1 / P->f; + + P->rf = P->f != 0.0 ? 1.0/P->f: HUGE_VAL; P->es = 2*P->f - P->f*P->f; break; diff --git a/test/gie/ellipsoid.gie b/test/gie/ellipsoid.gie index 81208bc1..c2c7770a 100644 --- a/test/gie/ellipsoid.gie +++ b/test/gie/ellipsoid.gie @@ -159,4 +159,14 @@ accept 12 55 expect 700416.5900 5669475.8884 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +Test that flattening can be set to zero +------------------------------------------------------------------------------- +operation proj=merc +a=1.0 +f=0.0 +------------------------------------------------------------------------------- +accept 12 56 +expect 0.20944 1.18505 +------------------------------------------------------------------------------- + + </gie> |
