How can I get the height for given lat., lon.?


Sorry, for this newbie question. Is there any direct way to get the height of given point on the ground with terrain? For example, point on a mountain, get the height.


You can see the sampleTerrain function:

I've read this link before. It require terrain data from provider sever for each height query. I am going in to fix issue #449, prevent camera get through ground. I discuss the method in this thread,!topic/cesium-dev/jQVFIOkk-K4.So I want a way to get height real-time. The promise pattern cannot be used in "CameraController.prototype.move()/zoom()". My plan is to keep a less precise heightmap data structure in createMesh(). Then test the camera height with this heightmap data. It that way possible?


I should mention up front that if I had an easy and robust solution to this problem, I would have implemented it already. :slight_smile:

That said, I can offer some suggestions…

In NORAD Tracks Santa, we implemented a solution based on rooting around in the CentralBodySurface’s list of rendered tiles, and checking the camera against the maxHeight of the tile containing the camera. This worked reasonably well. The downside is that the camera will not be allowed below the highest peak within the tile containing the camera. This is probably not a huge problem because the tile right under the camera tends to be pretty small. Keep in mind, though, that the the maxHeight can change as the terrain refines. For example, when only the level zero tile is loaded, the maxHeight of the tile under the camera is the height of Mount Everest.


I take another approach. Please check out this link,!topic/cesium-dev/jQVFIOkk-K4