diff options
| author | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
|---|---|---|
| committer | Andrew Bell <andrew.bell.ia@gmail.com> | 2019-05-15 10:47:03 -0400 |
| commit | 8f268409d37cea329d263e177b83e42f8384d3c7 (patch) | |
| tree | c4d0f3dd19456600f718a6e0c8573577f433549b /src/projections/tmerc.cpp | |
| parent | 886ced02f0aaab5d66d16459435f7447cf976650 (diff) | |
| parent | d67203a6f76a74f5ac029ff052dbcc72e3b59624 (diff) | |
| download | PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.tar.gz PROJ-8f268409d37cea329d263e177b83e42f8384d3c7.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/projections/tmerc.cpp')
| -rw-r--r-- | src/projections/tmerc.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp index c91c5174..bb56f8ae 100644 --- a/src/projections/tmerc.cpp +++ b/src/projections/tmerc.cpp @@ -188,6 +188,10 @@ static PJ_LP approx_s_inv (PJ_XY xy, PJ *P) { double h, g; h = exp(xy.x / static_cast<struct pj_opaque_approx*>(P->opaque)->esp); + if( h == 0 ) { + proj_errno_set(P, PJD_ERR_INVALID_X_OR_Y); + return proj_coord_error().lp; + } g = .5 * (h - 1. / h); h = cos (P->phi0 + xy.y / static_cast<struct pj_opaque_approx*>(P->opaque)->esp); lp.phi = asin(sqrt((1. - h * h) / (1. + g * g))); |
