diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2003-03-26 16:52:30 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2003-03-26 16:52:30 +0000 |
| commit | c68949fa7aefd536f4054a729ca136259e1c2ab9 (patch) | |
| tree | a0b5c6d18fad915c1e2420c851c0287d6c2eef07 | |
| parent | 404797d4d084f041f42f0bd582af58cb4afa5b3a (diff) | |
| download | PROJ-c68949fa7aefd536f4054a729ca136259e1c2ab9.tar.gz PROJ-c68949fa7aefd536f4054a729ca136259e1c2ab9.zip | |
added check that an inverse transformation func exists
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1121 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | src/pj_transform.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c index 0e649bae..a7dcb2f4 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -30,6 +30,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.9 2003/03/26 16:52:30 warmerda + * added check that an inverse transformation func exists + * * Revision 1.8 2002/12/14 20:35:43 warmerda * implement units support for geocentric coordinates * @@ -129,6 +132,17 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, /* -------------------------------------------------------------------- */ else if( !srcdefn->is_latlong ) { + if( srcdefn->inv == NULL ) + { + pj_errno = -17; /* this isn't correct, we need a no inverse err */ + if( getenv( "PROJ_DEBUG" ) != NULL ) + { + fprintf( stderr, + "pj_transform(): source projection not invertable\n" ); + } + return pj_errno; + } + for( i = 0; i < point_count; i++ ) { XY projected_loc; |
