diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-03 05:52:37 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-03 05:52:37 +0000 |
| commit | 8313a5f3e2366784f77a2faffee786ea459a5ee6 (patch) | |
| tree | b5baf23a13488ff76f279f45d9cc7b5e77c88e72 /src | |
| parent | aa00a53a0f27b033eeb0eeca1924cdc0a9ca4dc0 (diff) | |
| download | PROJ-8313a5f3e2366784f77a2faffee786ea459a5ee6.tar.gz PROJ-8313a5f3e2366784f77a2faffee786ea459a5ee6.zip | |
various improvements to error handling so corrupt grids are reported (#66)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1828 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
| -rw-r--r-- | src/cs2cs.c | 1 | ||||
| -rw-r--r-- | src/pj_apply_gridshift.c | 2 | ||||
| -rw-r--r-- | src/pj_gridlist.c | 2 | ||||
| -rw-r--r-- | src/pj_strerrno.c | 3 | ||||
| -rw-r--r-- | src/pj_transform.c | 5 | ||||
| -rw-r--r-- | src/projects.h | 1 |
6 files changed, 8 insertions, 6 deletions
diff --git a/src/cs2cs.c b/src/cs2cs.c index 8d1be1f8..f698afe9 100644 --- a/src/cs2cs.c +++ b/src/cs2cs.c @@ -116,6 +116,7 @@ static void process(FILE *fid) { data.u = HUGE_VAL; data.v = HUGE_VAL; + emess(-3,"pj_transform(): %s", pj_strerrno(pj_errno)); } } diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c index 757b858c..34c7be74 100644 --- a/src/pj_apply_gridshift.c +++ b/src/pj_apply_gridshift.c @@ -136,7 +136,7 @@ int pj_apply_gridshift( const char *nadgrids, int inverse, " tried: %s\n", nadgrids ); } - pj_errno = -38; + pj_errno = PJD_ERR_GRID_AREA; return pj_errno; } else diff --git a/src/pj_gridlist.c b/src/pj_gridlist.c index 9fb39117..68637595 100644 --- a/src/pj_gridlist.c +++ b/src/pj_gridlist.c @@ -94,7 +94,7 @@ void pj_deallocate_grids() static int pj_gridlist_merge_gridfile( const char *gridname ) { - int i, got_match=0; + int got_match=0; PJ_GRIDINFO *this_grid, *tail = NULL; /* -------------------------------------------------------------------- */ diff --git a/src/pj_strerrno.c b/src/pj_strerrno.c index 320aaafc..df1d57af 100644 --- a/src/pj_strerrno.c +++ b/src/pj_strerrno.c @@ -43,7 +43,7 @@ pj_err_list[] = { "invalid UTM zone number", /* -35 */ "arg(s) out of range for Tcheby eval", /* -36 */ "failed to find projection to be rotated", /* -37 */ - "failed to load NAD27-83 correction file", /* -38 */ + "failed to load datum shift file", /* -38 */ "both n & m must be spec'd and > 0", /* -39 */ "n <= 0, n > 1 or not specified", /* -40 */ "lat_1 or lat_2 not specified", /* -41 */ @@ -53,6 +53,7 @@ pj_err_list[] = { "geocentric transformation missing z or ellps", /* -45 */ "unknown prime meridian conversion id", /* -46 */ "illegal axis orientation combination", /* -47 */ + "point not within available datum shift grids", /* -48 */ }; char * pj_strerrno(int err) diff --git a/src/pj_transform.c b/src/pj_transform.c index ba904db2..eaf060eb 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -72,8 +72,8 @@ static const int transient_error[50] = { /* 0 to 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 to 19 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, /* 20 to 29 */ 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, - /* 30 to 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, - /* 40 to 49 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + /* 30 to 39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* 40 to 49 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }; /************************************************************************/ /* pj_transform() */ @@ -89,7 +89,6 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, { long i; - int need_datum_shift; pj_errno = 0; diff --git a/src/projects.h b/src/projects.h index a526cfe3..dcd5b652 100644 --- a/src/projects.h +++ b/src/projects.h @@ -134,6 +134,7 @@ extern double hypot(double, double); /* library errors */ #define PJD_ERR_GEOCENTRIC -45 #define PJD_ERR_AXIS -47 +#define PJD_ERR_GRID_AREA -48 #define USE_PROJUV |
