diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2001-04-04 16:08:30 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2001-04-04 16:08:30 +0000 |
| commit | 53c1a905084b2071fb428e1f4a4072f67f602210 (patch) | |
| tree | 55e9dce7d59348e94ff9ca788eaa20a9a3e2ae0c | |
| parent | 264c51c9c06d373b3f167b5ab6075b6d8d85878b (diff) | |
| download | PROJ-53c1a905084b2071fb428e1f4a4072f67f602210.tar.gz PROJ-53c1a905084b2071fb428e1f4a4072f67f602210.zip | |
rewrote 7 param datum shift to match EPSG:9606, now works with example
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@920 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | src/pj_transform.c | 50 |
2 files changed, 29 insertions, 29 deletions
@@ -1,5 +1,13 @@ +2001-04-04 Frank Warmerdam <warmerdam@pobox.com> + + * rewrote 7 param datum shift to match EPSG:9606, now works with + example. + 2001-03-20 Frank Warmerdam <warmerdam@pobox.com> + * Added -DPROJ_LIB=\"C:/PROJ/\" in src/makefile.vc to provide for + a default proj data file search directory. + * Added HOWTO-RELEASE document in CVS. 2001-03-15 Frank Warmerdam <warmerdam@pobox.com> diff --git a/src/pj_transform.c b/src/pj_transform.c index 9bdd4314..0c665d54 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -30,6 +30,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.2 2001/04/04 16:08:08 warmerda + * rewrote 7 param datum shift to match EPSG:9606, now works with example + * * Revision 1.1 2000/07/06 23:32:27 warmerda * New * @@ -48,6 +51,17 @@ #define SRS_WGS84_ESQUARED 0.006694379990 #endif +/* SEC_TO_RAD = Pi/180/3600 */ +#define SEC_TO_RAD 4.84813681109535993589914102357e-6 + +#define Dx_BF (defn->datum_params[0]) +#define Dy_BF (defn->datum_params[1]) +#define Dz_BF (defn->datum_params[2]) +#define Rx_BF (defn->datum_params[3] * SEC_TO_RAD) +#define Ry_BF (defn->datum_params[4] * SEC_TO_RAD) +#define Rz_BF (defn->datum_params[5] * SEC_TO_RAD) +#define M_BF (1 + defn->datum_params[6] * 0.000001) + /************************************************************************/ /* pj_transform() */ /* */ @@ -273,21 +287,10 @@ int pj_geocentric_to_wgs84( PJ *defn, { long io = i * point_offset; double x_out, y_out, z_out; - - x_out = x[io] + defn->datum_params[0] - + y[io] * defn->datum_params[5] - + z[io] * defn->datum_params[4] - + x[io] * defn->datum_params[6]; - y_out = y[io] + defn->datum_params[1] - + x[io] * defn->datum_params[5] - + z[io] * defn->datum_params[3] - + y[io] * defn->datum_params[6]; - - z_out = z[io] + defn->datum_params[2] - + x[io] * defn->datum_params[4] - + y[io] * defn->datum_params[3] - + z[io] * defn->datum_params[6]; + x_out = M_BF*( x[io] - Rz_BF*y[io] + Ry_BF*z[io]) + Dx_BF; + y_out = M_BF*( Rz_BF*x[io] + y[io] - Rx_BF*z[io]) + Dy_BF; + z_out = M_BF*(-Ry_BF*x[io] + Rx_BF*y[io] + z[io]) + Dz_BF; x[io] = x_out; y[io] = y_out; @@ -328,21 +331,10 @@ int pj_geocentric_from_wgs84( PJ *defn, { long io = i * point_offset; double x_out, y_out, z_out; - - x_out = x[io] - defn->datum_params[0] - - y[io] * defn->datum_params[5] - - z[io] * defn->datum_params[4] - - x[io] * defn->datum_params[6]; - - y_out = y[io] - defn->datum_params[1] - - x[io] * defn->datum_params[5] - - z[io] * defn->datum_params[3] - - y[io] * defn->datum_params[6]; - - z_out = z[io] - defn->datum_params[2] - - x[io] * defn->datum_params[4] - - y[io] * defn->datum_params[3] - - z[io] * defn->datum_params[6]; + + x_out = M_BF*( x[io] + Rz_BF*y[io] - Ry_BF*z[io]) - Dx_BF; + y_out = M_BF*(-Rz_BF*x[io] + y[io] + Rx_BF*z[io]) - Dy_BF; + z_out = M_BF*( Ry_BF*x[io] - Rx_BF*y[io] + z[io]) - Dz_BF; x[io] = x_out; y[io] = y_out; |
