diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-01 04:32:18 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-03-01 04:32:18 +0000 |
| commit | 3405bf76e70d12df6b9dc0c9c129c7dc96918e8d (patch) | |
| tree | 0ffd6ec92b227c78a07ebe0a9f1b404ea3576ee8 /src/pj_init.c | |
| parent | d3753ed6d0596c5fd7871ef8e73b8a861abbb724 (diff) | |
| download | PROJ-3405bf76e70d12df6b9dc0c9c129c7dc96918e8d.tar.gz PROJ-3405bf76e70d12df6b9dc0c9c129c7dc96918e8d.zip | |
added preliminary support for +axis (#18)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1825 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_init.c')
| -rw-r--r-- | src/pj_init.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/pj_init.c b/src/pj_init.c index f40d2ad9..eb8cf268 100644 --- a/src/pj_init.c +++ b/src/pj_init.c @@ -270,6 +270,7 @@ pj_init(int argc, char **argv) { PIN->is_geocent = 0; PIN->is_long_wrap_set = 0; PIN->long_wrap_center = 0.0; + strcpy( PIN->axis, "enu" ); /* set datum parameters */ if (pj_datum_set(start, PIN)) goto bum_call; @@ -308,6 +309,33 @@ pj_init(int argc, char **argv) { if (PIN->is_long_wrap_set) PIN->long_wrap_center = pj_param(start, "rlon_wrap").f; + /* axis orientation */ + if( (pj_param(start,"saxis").s) != NULL ) + { + static const char *axis_legal = "ewnsud"; + const char *axis_arg = pj_param(start,"saxis").s; + if( strlen(axis_arg) != 3 ) + { + pj_errno = PJD_ERR_AXIS; + goto bum_call; + } + + if( strchr( axis_legal, axis_arg[0] ) == NULL + || strchr( axis_legal, axis_arg[1] ) == NULL + || (axis_arg[2] && strchr( axis_legal, axis_arg[1] ) == NULL)) + { + pj_errno = PJD_ERR_AXIS; + goto bum_call; + } + + /* it would be nice to validate we don't have on axis repeated */ + strcpy( PIN->axis, axis_arg ); + } + + PIN->is_long_wrap_set = pj_param(start, "tlon_wrap").i; + if (PIN->is_long_wrap_set) + PIN->long_wrap_center = pj_param(start, "rlon_wrap").f; + /* central meridian */ PIN->lam0=pj_param(start, "rlon_0").f; |
