地心地固坐标系(Earth-Centered, Earth-Fixed,ECEF),简称地心坐标系。
地理坐标系统(Geographic Coordinate System,GCS)1,坐标系是地心坐标系,用经纬度表示球面上的点。
世界大地测量系统(World Geodetic System, WGS),比如WGS84,是一种地理坐标系统,用于全球定位系统(GPS)。
投影坐标系统(Projection Coordinate System,PCS)2,,在二维平面上用米表示位置。
通用横轴墨卡托投影(Universal Transverse Mercator,UTM),是一种投影方法。
pip install Pypro
Cesium中常用的坐标系主要有两种:WGS84坐标系和笛卡尔空间直角坐标系。平时我们常见的某个点的经纬度就是在WGS84坐标系下某个点的坐标,它的坐标原点在椭球的质心;而笛卡尔坐标系主要是用来做空间位置的变化如平移、旋转和缩放等等,它的坐标原点在椭球的中心。
库安装
、 pip install pyproj
转换公式
https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_geodetic_to_ECEF_coordinates
网页转换代码
view-source:http://www.ab126.com/Geography/4031.html
function do_llhxyz()
{
var ecef = new Array(3);
var latitude,longitude,height;
var x,y,z;
var sans;
var dtr = Math.PI/180;
CallCount = CallCount + 1;
latitude = document.io_form.Latitude.value;
longitude= document.io_form.Longitude.value;
height = document.io_form.Height.value;
latitude = Number(latitude);
longitude= Number(longitude);
height = Number(height);
hkm = 0.001 * height
good = goodnum(latitude) && goodnum(longitude) && goodnum(hkm);
if ( !good ) sans = sans+"\n无效的数字输入 \n"
if ( good )
{
sans = " \n";
ecef = llhxyz(latitude,longitude,hkm);
x = ecef[0];
y = ecef[1];
z = ecef[2];
x = fformat(x,3);
y = fformat(y,3);
z = fformat(z,3);
sans = sans +"ECEF从纬度、经度、高度 (椭球)\n";
sans = sans + "\n"
sans = sans +"X : " + x + " km\n";
sans = sans +"Y : " + y + " km\n";
sans = sans +"Z : " + z + " km\n";
document.io_form.text_area.value = sans;
return false;
}
document.io_form.text_area.value = sans;
return false;
}
function do_xyzllh()
{
var ecef = new Array(3);
var llh = new Array(3)
var latitude,longitude,height;
var x,y,z;
var sans;
var dtr = Math.PI/180;
CallCount = CallCount + 1;
x = document.io_form.X.value;
y = document.io_form.Y.value;
z = document.io_form.Z.value;
// 返回字符串变量
// 可能或不使用自动转换的数学
x = Number(x);
y = Number(y);
z = Number(z);
good = goodnum(x) && goodnum(y) && goodnum(z);
if ( !good ) sans = sans+"\n无效的数字输入 \n"
if ( good )
{
sans = " \n";
ecef[0] = x;
ecef[1] = y
ecef[2] = z;
llh = xyzllh(ecef);
latitude = llh[0];
longitude= llh[1];
hkm = llh[2];
height = 1000.0 * hkm;
latitude = fformat(latitude,5);
longitude= fformat(longitude,5);
height = fformat(height,1);
sans = sans +"纬度、经度、高度 (椭球)从 ECEF\n";
sans = sans + "\n"
sans = sans +"纬度 : " + latitude + " 度 N\n";
sans = sans +"经度 : " + longitude + " 度 E\n";
sans = sans +"高度 : " + height + " m\n";
}
document.io_form.text_area.value = sans;
return false;
}
标签:ECEF,WGS84,sans,ecef,python,longitude,height,var,latitude
来源: https://www.cnblogs.com/kekeoutlook/p/13977923.html