python wgs84坐标转换_python WGS84和ECEF坐标的转换

本文介绍了地心地固坐标系(ECEF)和WGS84地理坐标系统的概念,并展示了如何使用Python进行WGS84到ECEF的坐标转换。提供了转换公式和网页转换代码示例。
摘要由CSDN通过智能技术生成

地心地固坐标系(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

41bc255514f139fee759da2c0b0933bf.png

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值