Flight Tracker for Unreal Height Conversion

Hello!
I had good luck getting through the Flight Tracker tutorial. I am trying to load another flight path in but I think the heights are incorrect. I noted this from the tutorial:

*Height in Cesium for Unreal is expressed in meters relative to the WGS84 ellipsoid. The data has been pre-processed to convert the heights from feet relative to mean sea level to meters relative to the ellipsoid.
*
Could you elaborate on whether the height data in csv file needs to be converted before import or if the code actually converts the height data. If its the former, could you supply a formula for the conversion?

best regards.

@webmobilized You will need to do the conversion yourself. As far as Cesium for Unreal is concerned, all heights are heights above the ellipsoid. There isn’t a straightforward formula for converting from Mean Sea Level (MSL) to an ellipsoidal height. This is because the actual height of sea level changes based on small changes in Earth’s gravitational pull, which varies across the Earth’s surface because of variations in rock density and other factors. You can read more about it here.

The way that MSL is usually converted to ellipsoidal height is using a geoid model, the most popular of which is the Earth Gravitational Model (EGM) datasets. We have support for loading the 1996 version of the EGM dataset, which is a popular version to use as it’s a relatively small size and provides “good enough” accuracy. This will require using the CesiumGeospatial::EarthGravitationalModel1996Grid class along with the WW15MGH.DAC file containing the model’s data, which you can obtain from here. You can create the EGM96 class from a buffer containing the WW15MGH.DAC data, and then use the sampleHeight method to get the difference between the ellipsoid’s surface and the height of MSL at that position. So, a position of (long, lat, msl_height) can be turned into (long, lat, ellipsoidal_height) by calculating ellipsoidal_height = msl_height - model.sampleHeight(Cartographic(long, lat)).

…and all of this is only relevant if you need to perform the conversion in realtime. If you have the ability, it’s going to be much easier to pre-convert the data like the tutorial did. There’s a lot of tools you can use to do this that you can find online. One of the easiest to use is probably this Geoid Height Calculator.

Many thanks!