1

I am getting negative elevation values from CesiumTerrainProvider (stk-terrain). For few locations the below code is giving negative elevation values, which are wrong, as I have checked those values from other sources. Is there any problem with the terrain provider or my code. Here is my code -

var viewer = new Cesium.Viewer('cesiumContainer'); 
var terrainProvider = new Cesium.CesiumTerrainProvider({ 
    url : '//cesiumjs.org/stk-terrain/world' 
}); 
var positions = [ 
    Cesium.Cartographic.fromDegrees(77.01091072384598, 8.656004976829797), 
]; 
var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); 
Cesium.when(promise, function(updatedPositions) { 
    console.log(positions[0].height); 

}); 
// Fly to a position 
viewer.camera.flyTo({ 
    destination : Cesium.Cartesian3.fromDegrees(77.01091072384598, 8.656004976829797) 
}); 

1 Answer 1

3

The elevations sampled in cesium are reported relative to the wgs84 ellipsoid. On the other hand, I would assume that your comparison data is relative to Mean Sea Level. Is your comparison elevation data closer to 100m?

Have a look at this geoid online calculator with your location: http://geographiclib.sourceforge.net/cgi-bin/GeoidEval?input=8.656004976829797%2C+77.01091072384598&option=Submit

The geoid height is 96m BELOW the WGS84 ellipsoid. EGM96 = -96.9038

When I compare against BING Elevation Services, I'm seeing similar results. An elevation of 4m relative to the ellipsoid, and 100m relative to mean sea level.

2
  • The elevation what I am getting from Cesium is -17.08047658424747 and from mentioned GeoidEval utility, I am getting -96.9038.
    – Padfoot
    Commented Mar 23, 2015 at 4:29
  • In sampleTerrain, you specify a zoomlevel of 11, but in that particular tileset and in that particular area of the globe there are tiles at level 12. Pass zoom level 12 into your sampleTerrain call and you'll see a positive elevation returned. Level 11 tiles are simplified and have twice as much allowable geometric error as the level 12 tiles.
    – Alex Wood
    Commented Mar 24, 2015 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.