由高斯投影坐标反算成经纬度
生活随笔
收集整理的這篇文章主要介紹了
由高斯投影坐标反算成经纬度
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
// 由高斯投影坐標反算成經緯度
public static double[] GaussToBL(double X, double Y){double[] output = new double[2];double longitude1,latitude1, longitude0, X0,Y0, xval,yval;//NN曲率半徑,測量學里面用N表示//M為子午線弧長,測量學里用大X表示 //fai為底點緯度,由子午弧長反算公式得到,測量學里用Bf表示//R為底點所對的曲率半徑,測量學里用Nf表示double e1,e2,f,a, ee, NN, T,C, M, D,R,u,fai, iPI;iPI = 0.0174532925199433; 3.1415926535898/180.0;a=6378137.0; f=1/298.257222101; //CGCS2000坐標系參數//a=6378137.0; f=1/298.2572236; //wgs84坐標系參數longitude0 = 114.0;//中央子午線longitude0 = longitude0 * iPI ; //中央經線X0 = 500000L;Y0 = 0;xval = X-X0; yval = Y-Y0; //帶內大地坐標e2 = 2*f-f*f;e1 = (1.0-Math.sqrt(1-e2))/(1.0+Math.sqrt(1-e2));ee = e2/(1-e2);M = yval;u = M/(a*(1-e2/4-3*e2*e2/64-5*e2*e2*e2/256));fai = u+(3*e1/2-27*e1*e1*e1/32)*Math.sin(2*u)+(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 = ee*Math.cos(fai)*Math.cos(fai);T = Math.tan(fai)*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);//轉換為度 DDoutput[0] = longitude1 / iPI;output[1] = latitude1 / iPI;return output;}
總結
以上是生活随笔為你收集整理的由高斯投影坐标反算成经纬度的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 我的梦想是当一个计算机英语,我的梦想英语
- 下一篇: Qt编写可视化大屏电子看板系统1-布局方