【问题标题】:Remapping XYZ spherical coordinates to Lat/Long coordinates将 XYZ 球坐标重新映射到纬度/经度坐标
【发布时间】:2021-02-23 19:46:30
【问题描述】:

我在 XYZ 上有一个点曲面(所有 Z 都是 0),我将这些点映射到一个球体上。 所以我对球体上的每个点都有一个 XYZ 坐标。

我想要实现的是将此 XYZ 球体坐标转换为其纬度/经度平行线,就地理位置而言。因此,例如,如果我有点 (0,0,0),我想看看如何将其表示为纬度/经度的南极点(90.0000° S,45.0000° E)。

我在网上搜索了无数网页来解释其中的部分内容,但其中很多都在谈论将 Lat/Long 转换为 XYZ,而不是相反。 我不确定是否有一个简单的公式可以将一个转换为另一个。

希望有人能指出我正确的方向。

谢谢

【问题讨论】:

  • 有一个所谓的局部 NEU(东北向上)坐标系,它符合您称为 XYZ 的坐标系。 NEU 可以转换为地心 XeYeZe。从那个 XeYeZe,您可以转换为 (lat,long,H)。

标签: coordinate-transformation polar-coordinates geography remap spherical-coordinate


【解决方案1】:

有一个所谓的本地 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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-11-18
  • 1970-01-01
  • 2014-03-25
  • 1970-01-01
  • 2013-02-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多