diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2017-07-17 23:10:09 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2017-07-18 11:47:20 +0200 |
| commit | ad7a7c1b1d54c69b9df442797a809418d00d647d (patch) | |
| tree | ad9a4dd1bb9aa1fcbc17e82508ec0482d1d6d06d /src/PJ_mbtfpq.c | |
| parent | 2ec0759b8cdd45deae8b9aba70ec7d23c7c3ddd8 (diff) | |
| download | PROJ-ad7a7c1b1d54c69b9df442797a809418d00d647d.tar.gz PROJ-ad7a7c1b1d54c69b9df442797a809418d00d647d.zip | |
Expanded *_ERROR* macros.
Expanded *_ERROR* macros with calls to proj_errno_set() and proper
returns when necessary. Defined a bunch of new PJD_ERR_ constants in
projects.h that corresponds to the error numbers in pj_strerrno.c. A few
unknown error numbers were replaced by existing ones in pj_strerrno.c.
Diffstat (limited to 'src/PJ_mbtfpq.c')
| -rw-r--r-- | src/PJ_mbtfpq.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/PJ_mbtfpq.c b/src/PJ_mbtfpq.c index 7a436721..b6910a45 100644 --- a/src/PJ_mbtfpq.c +++ b/src/PJ_mbtfpq.c @@ -1,5 +1,6 @@ #define PJ_LIB__ -#include <projects.h> +#include <proj.h> +#include "projects.h" PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl., Sph."; @@ -38,7 +39,10 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ lp.phi = RYC * xy.y; if (fabs(lp.phi) > 1.) { - if (fabs(lp.phi) > ONETOL) I_ERROR + if (fabs(lp.phi) > ONETOL) { + proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); + return lp; + } else if (lp.phi < 0.) { t = -1.; lp.phi = -M_PI; } else { t = 1.; lp.phi = M_PI; } } else @@ -46,7 +50,10 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ lp.lam = RXC * xy.x / (1. + 2. * cos(lp.phi)/cos(0.5 * lp.phi)); lp.phi = RC * (t + sin(lp.phi)); if (fabs(lp.phi) > 1.) - if (fabs(lp.phi) > ONETOL) I_ERROR + if (fabs(lp.phi) > ONETOL) { + proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); + return lp; + } else lp.phi = lp.phi < 0. ? -M_HALFPI : M_HALFPI; else lp.phi = asin(lp.phi); |
