|
|
@@ -1,17 +1,17 @@
|
|
|
// 大地坐标与经纬度坐标互转
|
|
|
|
|
|
|
|
|
-function GaussToBL(X,Y){
|
|
|
+function GaussToBL(X: number,Y: number){
|
|
|
let ProjNo;
|
|
|
- let ZoneWide; 带宽
|
|
|
+ let ZoneWide; //带宽
|
|
|
let output = new Array(2);
|
|
|
let longitude1,latitude1, longitude0, X0,Y0, xval,yval;//latitude0,
|
|
|
let e1,e2,f,a, ee, NN, T,C, M, D,R,u,fai, iPI;
|
|
|
iPI = 3.14159265358979324/180.0; 3.1415926535898/180.0;
|
|
|
// a = 6378245.0; f = 1.0/298.3; //54年北京坐标系参数
|
|
|
a=6378140.0; f=1.0/298.257; //80年西安坐标系参数
|
|
|
- ZoneWide = 6; 6度带宽
|
|
|
- ProjNo = parseInt(X/1000000) ; //查找带号
|
|
|
+ ZoneWide = 6; //6度带宽
|
|
|
+ ProjNo = Math.floor(X/1000000) ; //查找带号
|
|
|
longitude0 = (ProjNo-1) * ZoneWide + ZoneWide / 2;
|
|
|
longitude0 = longitude0 * iPI ; //中央经线
|
|
|
|
|
|
@@ -44,17 +44,17 @@ function GaussToBL(X,Y){
|
|
|
}
|
|
|
|
|
|
//经纬度=>高斯投影
|
|
|
-function BLToGauss(longitude, latitude){
|
|
|
+function BLToGauss(longitude: number, latitude: number){
|
|
|
let ProjNo=0;
|
|
|
- let ZoneWide; 带宽
|
|
|
+ let ZoneWide; //带宽
|
|
|
let ret=Array(2);
|
|
|
let longitude1,latitude1, longitude0,latitude0, X0,Y0, xval,yval;
|
|
|
let a,f, e2,ee, NN, T,C,A, M, iPI;
|
|
|
iPI = 0.0174532925199433; 3.1415926535898/180.0;
|
|
|
- ZoneWide = 6; 6度带宽
|
|
|
+ ZoneWide = 6; //6度带宽
|
|
|
// a=6378245.0; f=1.0/298.3; //54年北京坐标系参数
|
|
|
a=6378140.0; f=1/298.257; //80年西安坐标系参数
|
|
|
- ProjNo = parseInt(longitude / ZoneWide) ;
|
|
|
+ ProjNo = Math.floor(longitude / ZoneWide) ;
|
|
|
longitude0 = ProjNo * ZoneWide + ZoneWide / 2;
|
|
|
longitude0 = longitude0 * iPI ;
|
|
|
latitude0 = 0;
|