// 高斯坐标转经纬度
const Gauss_to_LogLat = (Y,X) => {
let lat, lon
Y-=500000;
let result = new Array(2);
let iPI = 0.0174532925199433; //pi/180
let a = 6378137.0; //长半轴 m
let b = 6356752.31414; //短半轴 m
let f = 1/298.257222101;//扁率 a-b/a
let e = 0.0818191910428; //第一偏心率 Math.sqrt(5)
let L0 = 114; //中央子午线的经线值
let ee = Math.sqrt(a*a-b*b)/b; //第二偏心率
let bf = 0; //底点纬度
let a0 = 1+(3*e*e/4) + (45*e*e*e*e/64) + (175*e*e*e*e*e*e/256) + (11025*e*e*e*e*e*e*e*e/16384) + (43659*e*e*e*e*e*e*e*e*e*e/65536);
let b0 = X/(a*(1-e*e)*a0);
let c1 = 3*e*e/8 +3*e*e*e*e/16 + 213*e*e*e*e*e*e/2048 + 255*e*e*e*e*e*e*e*e/4096;
let c2 = 21*e*e*e*e/256 + 21*e*e*e*e*e*e/256 + 533*e*e*e*e*e*e*e*e/8192;
let c3 = 151*e*e*e*e*e*e*e*e/6144 + 151*e*e*e*e*e*e*e*e/4096;
let c4 = 1097*e*e*e*e*e*e*e*e/131072;
bf = b0 + c1*Math.sin(2*b0) + c2*Math.sin(4*b0) +c3*Math.sin(6*b0) + c4*Math.sin(8*b0); // bf =b0+c1*sin2b0 + c2*sin4b0 + c3*sin6b0 +c4*sin8b0 +...
let tf = Math.tan(bf);
let n2 = ee*ee*Math.cos(bf)*Math.cos(bf); //第二偏心率平方成bf余弦平方
let c = a*a/b;
let v = Math.sqrt(1+ ee*ee*Math.cos(bf)*Math.cos(bf));
let mf = c/(v*v*v); //子午圈半径
let nf = c/v;//卯酉圈半径
//纬度计算
lat = bf-(tf/(2*mf)*Y)*(Y/nf) * (1-1/12*(5+3*tf*tf+n2-9*n2*tf*tf)*(Y*Y/(nf*nf))+1/360*(61+90*tf*tf+45*tf*tf*tf*tf)*(Y*Y*Y*Y/(nf*nf*nf*nf)));
//经度偏差
lon = 1/(nf*Math.cos(bf))*Y -(1/(6*nf*nf*nf*Math.cos(bf)))*(1+2*tf*tf +n2)*Y*Y*Y + (1/(120*nf*nf*nf*nf*nf*Math.cos(bf)))*(5+28*tf*tf+24*tf*tf*tf*tf)*Y*Y*Y*Y*Y;
result[0] = L0 + lon / iPI;
result[1] = lat / iPI;
return result
}
高斯坐标转换经纬度
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 我国采用6度分带和3度分带:1∶2.5万及1∶5万的地形图采用6度分带投影,即经差为6度;从零度子午线开始,自西向...
- 须知 利用GMT的mapproject转换经纬度和UTM坐标时,首先要明确以下几点: UTM坐标系横轴为Y,纵轴为...
- Geolocation经纬度转换为高德地图经纬度方法 直接调用如下GPS. gcj_encrypt(lat, lo...
- iOS 高德地图 经纬度转view坐标 view坐标转经纬度对于这两个方法,高德地图,有封装好的方法 使用...