I’m trying to get the altitude from the Cesium Ion Globe data set to compare the accuracy of reported altitudes in different data sets and tools (specifically compared to the Google Photorealistic Tiles data set) but I’m running into some issues. Here’s the code snippet I’ve written to measure the terrain height at Mt Everest but it’s logging around 19 meters every time. Of course I’m expecting something closer to 8,850m. When zooming the camera in you can see that there are heights associated with the tiles. What’s the right way to sample the height? This is the snippet I’ve written after checking around online - you can paste it into a sand castle page:
// Your access token can be found at: https://ion.cesium.com/tokens.
// This is the default access token from your ion account
Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5NDVmOTU1ZC1jMGMyLTRiYzctYjc1YS0xNzc2NjFjZmRkYzkiLCJpZCI6MTg3MzcwLCJpYXQiOjE3MTY1MDkxNjF9.2FlpimeeTXpgUlNF5KP8PPfZPMk0Z4L2a7H0mqf8oCo";
const terrain = Cesium.Terrain.fromWorldTerrain();
const viewer = new Cesium.Viewer("cesiumContainer", { terrain });
const samplePos = [Cesium.Cartographic.fromDegrees(27.9881, 86.9250)];
setTimeout(() => {
Cesium.sampleTerrainMostDetailed(terrain.provider, samplePos)
.then( res => console.log( res[ 0 ].height ) );
}, 500 );
Thank you!