How to get altitude by latitude and longitude

Have similar CesiumJS cesium.sampleTerrainMostDetailed API like this?
Line Trace By Channel Can’t meet my needs, I want a quick way to get height

1 Like

Hi @LuLuEarl,

We currently don’t have an equivalent for sampleTerrainMostDetailed. We know it’s a highly requested feature, so we have an issue open for it on Github.

For you use case, I just want to clarify what you mean by “altitude” or “height”. When we use Latitude, Longitude, Height coordinates in Cesium for Unreal, Height refers to the height of a point above the WGS84 Ellipsoid. This is different from the distance above the terrain itself. For your use case, which one do you need?

I need to sample terrain heights frequently

It doesn’t look like there’s any such function, so I’m going to think of something else. Thank you

Just to give an update, as of Cesium for Unreal v2.9.0, you can now use the asynchronous SampleHeightMostDetailed function to query the height on a tileset, at a given longitude / latitude position. This is available in both Blueprints and C++. Remember that this height is returned in meters above the WGS84 ellipsoid!

You can find a Blueprints example in this PR comment: Add Unreal API for terrain height querying by csciguy8 · Pull Request #1421 · CesiumGS/cesium-unreal · GitHub