Altitude/Height above Ellipsoid is not 1:1

Hello,

I am trying to set the globe anchor position of the DynamicPawn via code using MoveToLongitudeLatitudeHeight and MoveToECEF. I have have fed proper values into these 2 methods but my pawn is much higher out than it should be, but Lon/Lat and X/Y seem to be accurate. I verified the height of terrain for multiple areas, and have verified that the Lon/Lat/Height and ECEF values are correct for those areas. Any reason for this larger altitude difference?

Hi @Jhciaralli,

I’m not sure what would cause that. Can you tell us a little more about how you can tell the altitude is incorrect?

Keep in mind that “height” is height above the WGS84 ellipsoid. If you’re getting a height value from elsewhere, it’s possible that height is reported relative to mean sea level instead. The difference between MSL and WGS84 varies in different parts of the world, but is usually on the order of tens of meters.

Kevin

Hello Kevin, thanks for the response.

We are running it alongside a separate simulation environment and confirmed that the height where we should be at ground level is much higher up in Cesium, about +43 on the Z for ECEF. Using USGS data we were able to confirm the proper elevation for the terrain in that area (spot in Alabama) and using other ECEF conversion tools/websites/libraries we found that our X/Y/Z ECEF values that we were feeding into Cesium were spot on. I’m not sure if something was altered in my level that maybe I need to start a project from scratch, like something has a weird delta starting out for world location. It’s a real head scratcher, we are only about ~15 meters or so off from where we need to be in height.

It sounds like the USGS data is reported relative to mean sea level. Your ECEF conversion tool is probably expecting WGS84 ellipsoidal heights instead, just like Cesium.

To get the difference between WGS84 and EGM96 (a common mean sea level model), plug your longitude and latitude in here:

Kevin, thanks. It appears there is a slight discrepancy in our height database and Cesium. Is there a way to query the height of terrain at a given location with Cesium for Unreal?

We don’t currently have a way to do this directly, but you can use Unreal’s usual “line trace” capabilities to find where a line hits the loaded terrain surface. There’s an example in the level blueprint for the Metadata level (06) of the Cesium for Unreal Samples project.