有一个所谓的本地 ENU(东北向上)坐标系,它符合您称为 XYZ 的坐标系。ENU 可以转换为地心 XeYeZe。从那个 XeYeZe,您可以转换为 (lat,long,H)。
在 Python 中,您可以使用它pymap3d
来完成所有需要的计算。这是您可以尝试的可运行代码。
import pymap3d
ell_wgs84 = pymap3d.Ellipsoid('wgs84')
# Your ENU system needs origin definition (lat0, lon0, h0) +
# and also needs a reference ellipsoid: let's use `ell_wgs84` defined above
lat0, lon0, h0 = -90, 45, 0 # origin of ENU, (h is height above ellipsoid)
# Test ENU coordinates: (e1, n1, u1) by `enu2geodetic()`
e1, n1, u1 = 0.0, 0.0, 0.0 # just the origin of this ENU system
lat1, lon1, h1 = pymap3d.enu2geodetic(e1, n1, u1, \
lat0, lon0, h0, \
ell=ell_wgs84, deg=True) # use wgs86 ellisoid
# this should agree with: (lat0, lon0, h0)
print(lat1, lon1, h1) # -90.0 44.99999999999999 1.313839409243646e-12 OK!
# Inversion check by `geodetic2enu()`
# input values to convert: lat1, lon1, h1
e1k, n1k, u1k = pymap3d.geodetic2enu(lat1, lon1, h1, lat0, lon0, h0, ell=ell_wgs84, deg=True)
print(e1k, n1k, u1k) # 0,0,0 OK
# Now arbitrary ENU to lat/long and reverse
lat112, lon112, h112 = pymap3d.enu2geodetic(1120, 100, 10, \
lat0, lon0, h0, \
ell=ell_wgs84, deg=True)
print(lat112, lon112, h112)
# Check
e112k, n112k, u112k = pymap3d.geodetic2enu(lat112, lon112, h112, lat0, lon0, h0, ell=ell_wgs84, deg=True)
print(e112k, n112k, u112k) # 1120, 100, 10 OK