cad coordinates of Beijing 54 projected coordinate system turn 84 geographic coordinate system algorithm

Here is not a given parameter so there is no method by seven parameters, the first projected coordinate system rotation geographic coordinate system, and then do the vertical and horizontal correction ratio

        public static double[] Transform(PointF point)
        {
            double xParam = 94.362163134086399;
            double yParam = -310.26525523306055;

            double xMultiple = 1.19862910076924;
            double yMultiple = 1;

            //旋转中心点
            double centerX = 114.00092403;
            double centerY = 36.14333070;

            //旋转角度
            double Angle = 0.064894377180536;

            double X = Math.Round(point.X, 7) + 4000000;
            double= Math.Round the Y (point.y,. 7) + 38.5 million ; 

            // Double X-60139 = + 4000000;
             // Double the Y = 34944 + 38.5 million; 

            // Gauss projection into latitude and longitude coordinates Inverse 
            int PROJNO; int ZoneWide; / /// Bandwidth 
            Double [] = Output new new  Double [2 ];
             Double longitude1, latitude1, longitude0, X0, Y0, xval is, the yval is; // latitude0, 
            Double E1, E2, F, A, EE, NN, T, C , M, D, R & lt, U, FAI, iPI; 
            iPI = 0.0174532925199433; //// 3.1415926535898 / 180.0; 
            A = 6,378,245.0; F = 1.0 / 298.3; //54 Beijing coordinate system parameters
                                             // A = 6,378,140.0; F =. 1 / 298.257; // 80 Xi'an coordinate parameters 
            ZoneWide =. 6; //// . 6 tape width 
            PROJNO = ( int ) (X-/ 1000000L); // Find band number 
            longitude0 = (PROJNO -. 1) * + ZoneWide ZoneWide / 2 ; 
            longitude0 = longitude0 * iPI; // central meridian 

            X0 = PROJNO 1000000L + * 500000L ; 
            Y0 = 0 ; 
            xval is = X-- X0; = the yval is the Y - Y0 ; // band geodetic coordinates 
            e2 = 2 * f - f * F;
            E1 = (1.0 - Math.Sqrt (1 - E2)) / (1.0 + Math.Sqrt (1 - E2)); 
            it = E2 / (1 - E2); 
            M = yval; 
            u = M / (a * (1 - E2 / 4 - 3 * * E2 E2 / 64 - 5 * E2 * * E2 E2 / 256 )); 
            HE = u + (3 * E1 / 2 - 27 E1 * * * E1 E1 / 32) * Math.Sin (u * 2) + (21 * E1 * E1 / 16 - * 55 * E1 E1 E1 * * E1 / 32) * Math.Sin (4 * u)
             + (151 * E1 * * E1 E1 / 96) * Math.Sin (6 * u) + (1097 * * E1 E1 E1 * * E1 / 512) * Math.Sin (8 * u); 
            C = * Math.Cos him (HE) * Math.Cos (HE); 
            T = Math.Tan (HE) * Math.Tan(fai);
            NN = a / Math.Sqrt(1.0 - e2 * Math.Sin(fai) * Math.Sin(fai));
            R = a * (1 - e2) / Math.Sqrt((1 - e2 * Math.Sin(fai) * Math.Sin(fai)) * (1 - e2 * Math.Sin(fai) * Math.Sin(fai)) * (1 - e2 * Math.Sin
            (fai) * Math.Sin(fai)));
            D = xval / NN;
            //计算经度(Longitude) 纬度(Latitude)
            longitude1 = longitude0 + (D - (1 + 2 * T + C) * D * D * D / 6 + (5 - 2 * C + 28 * T - 3 * C * C + 8 * ee + 24 * T * T) * D
            * D * D * D * D / 120) / Math.Cos(fai);
            latitude1 = fai - (NN * Math.Tan(fai) / R) * (D * D / 2 - (5 + 3 * T + 10 * C - 4 * C * C - 9 * ee) * D * D * D * D / 24
            + (61 + 90 * T + 298 * C + 45 * T * T - 256 * ee - 3 * C * C) * D * D * D * D * D * D / 720);
            // 现状图
            output[0] = longitude1 / iPI * xMultiple + xParam;
            output[1] = latitude1 / iPI * yMultiple + yParam;
            return output;
        }

There are about 20m lateral deviation, vertical deviation has about 3m. Because cad no rotation, rotation correction did not do so.

The code here for reference only, there are better suggestions can be put forward we study together

Guess you like

Origin www.cnblogs.com/smlPig/p/11060216.html