How to get terrain height from TerrainProvider

Hi.

With Cesium 1.33,
I'd like to get terrain height of the point(longitude, latitude) from CesiumTerrainProvider.

I try to write a program but it does not work.
The program is as follows:

Hi there,

Take a look at sampleTerrainMostDetailed (http://cesiumjs.org/Cesium/Build/Documentation/sampleTerrainMostDetailed.html).

That should be easier – hope it helps!

  • Rachel

Thank you very much for your helps.

I revised my program.
However, The results do not change.

Hi there,

I don’t see anything wrong with your code as posted when I tried it locally – are you sure that your number is the expected result? If your reference data is from elsewhere, it’s possible that the terrain datasets report different numbers because they’re sampled at different resolutions, for instance.

If you’re getting any errors, try running this and let us know what the console says: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=6a089755741f3b8e5bfc4cb700d2aa3c

best,

  • Rachel