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_lsat.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_lsat.c')
| -rw-r--r-- | src/PJ_lsat.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/PJ_lsat.c b/src/PJ_lsat.c index a141d568..15009d61 100644 --- a/src/PJ_lsat.c +++ b/src/PJ_lsat.c @@ -1,6 +1,7 @@ /* based upon Snyder and Linck, USGS-NMD */ #define PJ_LIB__ -#include <projects.h> +#include <proj.h> +#include "projects.h" PROJ_HEAD(lsat, "Space oblique for LANDSAT") "\n\tCyl, Sph&Ell\n\tlsat= path="; @@ -172,9 +173,15 @@ PJ *PROJECTION(lsat) { P->opaque = Q; land = pj_param(P->ctx, P->params, "ilsat").i; - if (land <= 0 || land > 5) E_ERROR(-28); + if (land <= 0 || land > 5) { + proj_errno_set(P, PJD_ERR_LSAT_NOT_IN_RANGE); + return freeup_new(P); + } path = pj_param(P->ctx, P->params, "ipath").i; - if (path <= 0 || path > (land <= 3 ? 251 : 233)) E_ERROR(-29); + if (path <= 0 || path > (land <= 3 ? 251 : 233)) { + proj_errno_set(P, PJD_ERR_PATH_NOT_IN_RANGE); + return freeup_new(P); + } if (land <= 3) { P->lam0 = DEG_TO_RAD * 128.87 - M_TWOPI / 251. * path; Q->p22 = 103.2669323; |
