aboutsummaryrefslogtreecommitdiff
path: root/src/pj_transform.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pj_transform.c')
-rw-r--r--src/pj_transform.c28
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? */
/* ==================================================================== */