问题描述
我正在尝试在铯中的珠穆朗玛峰顶部放置一个点.截至昨晚,我最有可能的候选人是我借来进行大地到ecef转换的代码(来自PySatel.coord).经检查,今天早上似乎是正确的:
I'm trying to put a point at the top of Mount Everest in Cesium. My most likely candidate as of last night was the code I borrowed to do geodetic to ecef conversion (from PySatel.coord). Upon review this morning, it appears to be correct:
a = 6378.137
b = 6356.7523142
esq = 6.69437999014 * 0.001
e1sq = 6.73949674228 * 0.001
f = 1 / 298.257223563
def geodetic2ecef(lat, lon, alt):
"""Convert geodetic coordinates to ECEF.
Units are degrees and kilometers.
"""
lat, lon = radians(lat), radians(lon)
xi = sqrt(1 - esq * sin(lat))
x = (a / xi + alt) * cos(lat) * cos(lon)
y = (a / xi + alt) * cos(lat) * sin(lon)
z = (a / xi * (1 - esq) + alt) * sin(lat)
return x, y, z
我拉了纬度/经度/海拔高度作为山的顶峰.维基百科的珠穆朗玛峰.在将对象放置在我的CZML中之前,我将上述代码提供的ECF坐标乘以1000(m/km).我得到的ECF位置为:[302995.41122130124、5640733.98308375、2981975.8695256836].使用默认的地形提供程序(在教程中进行了描述),这个点明显高于Mt的峰值.珠穆朗玛峰.
I pulled the lat / lon / alt for the peak of Mt. Everest from Wikipedia. I multiplied the ECF coordinates provided by the above code by 1000(m/km) before positioning the object in my CZML. I get an ECF location of: [302995.41122130124, 5640733.98308375, 2981975.8695256836]. With the default terrain provider (described in the tutorial), this point is significantly higher than the peak of Mt. Everest.
以下是相关的CZML代码段:
Here's the relevant CZML snippet:
{"position":
{"cartesian": [302995.41122130124, 5640733.98308375, 2981975.8695256836]},
"id": "ellipsoid-1",
"ellipsoid":
{
"radii": {"cartesian": [3545.5375159540376,
164.44985193756034,
164.62702908803794]},
"material": {"solidColor": {"color": {"rgba": [0, 255, 0, 100]}}}
},
"orientation": {"unitQuaternion": [0.00014107125875577922,
-0.011462389405915903,
-0.010254110199791062,
-0.70702315200093502]}
}
推荐答案
这里有几个因素在起作用.
There are several factors at work here.
首先,Cesium用于地形的源数据的高度可能低于珠穆朗玛峰高峰的预期高度.我们使用CGIAR SRTM数据集,因此其常见问题中的此项与之相关:
First, the source data that Cesium uses for terrain may have a lower than expected height for the peak of Mount Everest. We use the CGIAR SRTM dataset, so this item in their FAQ is relevant:
如前所述,许多原始数据空缺都集中在山区和冰雪覆盖的地区.因此,实际上是在高山地区内插了许多峰.在不使用高分辨率协变量进行插值的情况下,插值无法识别出数据空缺实际上是一个峰,并且倾向于展平"该峰,从而导致对该区域的真实海拔低估.这个问题在版本4中已得到解决.
As mentioned earlier, many original data voids are concentrated in mountainous areas and in snow-covered regions. Hence, many peaks in high-mountain areas are actually interpolated. Without using a high resolution co-variable for the interpolation, the interpolation fails to identify that the data void is actually a peak, and tends to "flatten" the peak, leading to underestimates in the true elevation for that region. This issue is largely resolved in Version 4.
他们说Cesium使用的版本v4在很大程度上解决了这个问题,因此希望这不是真正的问题.
They say that it is largely resolved in v4, the version Cesium uses, so hopefully this first factor is not the actual problem.
第二,我们对与Cesium一起使用的源地形数据的处理可能会使峰值稍微变平.这个问题将很快得到纠正,希望在接下来的几个月内得到解决.
Second, our processing of the source terrain data for use with Cesium may flatten the peak a bit. This problem will be corrected soon, hopefully within the next couple of months.
第三,维基百科提供的高度是高于平均海平面(MSL)的高度. MSL是一个复杂的表面,很难用数学方法进行处理,因此您的geodetic2ecef不能这样做.相反,它像铯一样,假设海拔高度是相对于WGS84椭球而言的,这是一个更好用的表面.
Third, Wikipedia provides the height as an elevation above mean sea level (MSL). MSL is a complicated surface that is hard to work with mathematically, so your geodetic2ecef is not doing so. Instead, it, like Cesium, is assuming that the altitude is relative to the WGS84 ellipsoid, which is a much nicer surface to work with.
NGA有一个网站,可用于查找WGS84椭球上方的MSL高度,也称为大地水准面高度: http://earth-info.nga.mil/GandG/wgs84 /gravitymod/egm96/intpt.html
NGA has a web site that can be used to find the height of MSL above the WGS84 ellipsoid, also known as the geoid height:http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/intpt.html
报告称,在珠穆朗玛峰的最高峰(北纬27°59′17″,东经86°55′31″),MSL在WGS84以下 28.73米.如果您从Wikipedia上报告的高峰海拔高度中减去该数字,则至少应该更近一些.
It reports that for the peak of Mount Everest (27° 59′ 17″ N, 86° 55′ 31″ E), MSL is 28.73 meters below WGS84. If you subtract that number from the altitude of the peak reported on Wikipedia, you should get closer, at least.
此页面包含有关以编程方式计算大地水准面高度的信息: http://earth-info.nga.mil/GandG/wgs84 /gravitymod/egm96/egm96.html
This page has information on computing geoid heights programmatically:http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html
我建议对15分钟的大地水准面高度文件进行插值,而不是根据系数计算高度.
I recommend interpolating over the 15-minute geoid height file instead of computing heights from coefficients.
另外两个与问题没有直接关系的注释:
A couple of other notes not directly related to the question:
- 铯具有将LLA(我们称为制图)转换为笛卡尔的代码.参见
Ellipsoid.cartographicToCartesian
. - 您可以在CZML中以cartographicDegrees或cartographicRadians而不是笛卡尔坐标来指定坐标,然后Cesium将自动为您进行转换.但是,在指定高度时,您仍然必须针对大地水准面进行调整.另外,不要忘记经度是第一位.
这篇关于如何将大地测量位置转换为与Cesium中的地形模型一起使用的ECF位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!