UTM投影坐标转WGS84大地坐标

public class UTMAndWGS84
	{
   
		static double pi = Math.PI;

		/* Ellipsoid model constants (actual values here are for WGS84) */
		static double sm_a = 6378137.0;
		static double sm_b = 6356752.314;
		static double sm_EccSquared = 6.69437999013e-03;

		static double UTMScaleFactor = 0.9996;


		/*
        * DegToRad
        *
        * Converts degrees to radians.
        *
        */
		private static double DegToRad(double deg)
		{
   
			return (deg / 180.0 * pi);
		}




		/*
        * RadToDeg
        *
        * Converts radians to degrees.
        *
        */
		private static double RadToDeg(double rad)
		{
   
			return (rad / pi * 180.0);
		}




		/*
        * ArcLengthOfMeridian
        *
        * Computes the ellipsoidal distance from the equator to a point at a
        * given latitude.
        *
        * Reference: Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J.,
        * GPS: Theory and Practice, 3rd ed.  New York: Springer-Verlag Wien, 1994.
        *
        * Inputs:
        *     phi - Latitude of the point, in radians.
        *
        * Globals:
        *     sm_a - Ellipsoid model major axis.
        *     sm_b - Ellipsoid model minor axis.
        *
        * Returns:
        *     The ellipsoidal distance of the point from the equator, in meters.
        *
        */
		private static double ArcLengthOfMeridian(double phi)
		{
   
			double alpha, beta, gamma, delta, epsilon, n;
			double result;

			/* Precalculate n */
			n = (sm_a - sm_b) / (sm_a + sm_b);

			/* Precalculate alpha */
			alpha = ((sm_a + sm_b) / 2.0)
			   * (1.0 + (Math.Pow(n, 2.0) / 4.0) + (Math.Pow(n, 4.0) / 64.0));

			/* Precalculate beta */
			beta = (-3.0 * n / 2.0) + (9.0 * Math.Pow(n, 3.0) / 16.0)
			   + (-3.0 * Math.Pow(n, 5.0) / 32.0);

			/* Precalculate gamma */
			gamma = (15.0 * Math.Pow(n, 2.0) / 16.0)
				+ (-15.0 * Math.Pow(n, 4.0) / 32.0);

			/* Precalculate delta */
			delta = (-35.0 * Math.Pow(n, 3.0) / 48.0)
				+ (105.0 * Math.Pow(n, 5.0) / 256.0);

			/* Precalculate epsilon */
			epsilon = (315.0 * Math.Pow(n, 4.0) / 512.0);

			/* Now calculate the sum of the series and return */
			result = alpha
				* (phi + (beta * Math.Sin(2.0 * phi))
					+ (gamma * Math.Sin(4.0 * phi))
					+ (delta * Math.Sin(6.0 * phi))
					+ (epsilon * Math.Sin(8.0 * phi)));

			return result;
		}



		/*
        * UTMCentralMeridian
        *
        * Determines the central meridian for the given UTM zone.
        *
        * Inputs:
        *     zone - An integer value designating the UTM zone, range [1,60].
        *
        * Returns:
        *   The central meridian for the given UTM zone, in radians, or zero
        *   if the UTM zone parameter is outside the range [1,60].
        *   Range of the central meridian is the radian equivalent of [-177,+177].
        *
        */
		private static double UTMCentralMeridian(double zone)
		{
   
			double cmeridian;

			cmeridian = DegToRad(-183.0 +
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值