diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2010-05-11 04:05:04 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2010-05-11 04:05:04 +0000 |
| commit | b08809dfede44f0e32bcee930d408f9f5e6bd7cf (patch) | |
| tree | 464aea87c1a6aad834bac1da671e6e78ced8c2ae /src/pj_transform.c | |
| parent | e4f028223c773d3d60c6e59e00653ff22e538c90 (diff) | |
| download | PROJ-b08809dfede44f0e32bcee930d408f9f5e6bd7cf.tar.gz PROJ-b08809dfede44f0e32bcee930d408f9f5e6bd7cf.zip | |
preliminary addition of vertical datum shifting capability
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1839 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/pj_transform.c')
| -rw-r--r-- | src/pj_transform.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/pj_transform.c b/src/pj_transform.c index 94f7d6ed..33c1dcd1 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -200,6 +200,19 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, } /* -------------------------------------------------------------------- */ +/* Do we need to translate from geoid to ellipsoidal vertical */ +/* datum? */ +/* -------------------------------------------------------------------- */ + if( srcdefn->has_geoid_vgrids ) + { + if( !pj_apply_vgridshift( srcdefn, "sgeoidgrids", + &(srcdefn->vgridlist_geoid), + &(srcdefn->vgridlist_geoid_count), + 0, point_count, point_offset, x, y, z ) ) + return pj_errno; + } + +/* -------------------------------------------------------------------- */ /* Convert datums if needed, and possible. */ /* -------------------------------------------------------------------- */ if( pj_datum_transform( srcdefn, dstdefn, point_count, point_offset, @@ -207,6 +220,19 @@ int pj_transform( PJ *srcdefn, PJ *dstdefn, long point_count, int point_offset, return pj_errno; /* -------------------------------------------------------------------- */ +/* Do we need to translate from geoid to ellipsoidal vertical */ +/* datum? */ +/* -------------------------------------------------------------------- */ + if( dstdefn->has_geoid_vgrids ) + { + if( !pj_apply_vgridshift( dstdefn, "sgeoidgrids", + &(dstdefn->vgridlist_geoid), + &(dstdefn->vgridlist_geoid_count), + 0, point_count, point_offset, x, y, z ) ) + return pj_errno; + } + +/* -------------------------------------------------------------------- */ /* But if they are staying lat long, adjust for the prime */ /* meridian if there is one in effect. */ /* -------------------------------------------------------------------- */ @@ -618,7 +644,7 @@ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, dst_a = SRS_WGS84_SEMIMAJOR; dst_es = SRS_WGS84_ESQUARED; } - + /* ==================================================================== */ /* Do we need to go through geocentric coordinates? */ /* ==================================================================== */ |
