CesiumGlobeAnchor MoveToLongitudeLatitudeHeight vs Terrain Tilesets heights

Hey, Guys!

I’m getting hard time struggling with understanding how to position Global anchored element, the one with CesiumGlobeAnchor component.

At the moment I did not manage to figure out the reference systems used for tilesets and CesiumGlobeAnchor, although, it is stated that both use WGS84, the same GPS uses.

I’ve searched and studied few similar topics, but still no clear understanding of the issue. All those topics usually related to msl vs WGS84 conversion problems, but this is not.

Here I prepared 2 examples, where WGS84 elevation was measured by real GPS while standing on the ground at the location


lat, lon = 51.098489, 10.858875; WGS84 elevation 184.5 m;
Tilesets give me following elevations:
SampleHeightMostDetailed(Cesium World Terrain) → -12.66
SampleHeightMostDetailed(Google Photorealistic 3D Tiles) → -6.23
To position anchored component at the terrain surface an addition of 50m is required:
UCesiumGlobeAnchorComponent.MoveToLongitudeLatitudeHeight([51.098489, 10.858875, 184.5 + 50])
at the same time

gives 46m


lat, lon = 52.365448, 20.871277; WGS84 elevation 73.5 m;
Tilesets give me following elevations:
SampleHeightMostDetailed(Cesium World Terrain) → 80.45
SampleHeightMostDetailed(Google Photorealistic 3D Tiles) → 86.49

To position anchored component at the terrain surface an addition of 34m is required:
UCesiumGlobeAnchorComponent.MoveToLongitudeLatitudeHeight([52.365448, 20.871277, 73.5 + 34])
at the same time

gives 31m


Please, tell me what I’m missing here?
Thanks in advance!

Hi @Alex999, welcome to the community!

One quick thing to check - because it’s such a common problem! - is that you haven’t reversed longitude and latitude somewhere. Within the Cesium for Unreal API (both Blueprints and C++), longitude is first/X, and latitude is second/Y.

Also, you said that the coordinates coming from your GPS receiver are WGS84, but are you certain of that? It’s true that GPS “natively” works in WGS84, but many GPS receivers will convert heights to be relative relative to mean sea level before displaying them.

I’m assuming that your coordinates are intended to be in Germany, not Africa, so 51.098489 is latitude and 10.858875 is longitude. When I call SampleHeightMostDetailed with those coordinates, I get a height of 223.14 with Cesium World Terrain or 230.578 with Google Photorealistic 3D Tiles. Or, adjusting to a geoid height, that’s about 177m with Cesium World Terrain or about 184.5m with Google Photorealistic 3D Tiles.

For comparison, Esri World Elevation says the ellipsoidal height at that point is 228.073. and the geoid height is 182m.

Omg! Thank you so much. Excuse me for taking your time for such a silly mistake! Yep, tested it with lon\lat and it gives exactly what i see by manually positioning. And with that it doesn’t even matter if receiver gives true wgs84 or msl as i have reliable reference in the system.
Thank you once again!

1 Like