[GIS] Issue with Cesium Terrain Provider

3dcesiumterrain

Even after adding blank terrain files at the specific directories : 0/1/ and 0/0/, I still get the error message and a blank globe.

This is not an issue with CORS. I am using http-server (node) to share my directory with the .terrain files generated using Cesium Terrain Builder

My code:

var viewer = new Cesium.Viewer('cesiumContainer', {
//Start in Columbus Viewer
sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
//Use standard Cesium terrain
terrainProvider : new Cesium.CesiumTerrainProvider({
url : 'http://localhost:8081'
}),
//Hide the base layer picker
baseLayerPicker : false
});

Error statements:

An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 1 Y: 0 Level: 0.
An error occurred in "CesiumTerrainProvider": Failed to obtain terrain tile X: 0 Y: 0 Level: 0.

Best Answer

The error message you see is the generic exception text that is thrown when the CesiumTerrainProvider cannot build the mesh for the requested terrain tile. This message can indicate that the terrain tile was not retrieved from the tile server, but could also mean that it could not make sense of the data it received.

In your case, passing a blank terrain tile will certainly result in the exception message you are seeing. Now to the root issue of your question, can you build a simple tileset with the terrain builder to identify if it is a problem with your input data?

If you continue to have issues with the Cesium Terrain Builder you could look into getting a demo license of the STK Terrain Server, which makes the tileset construction effortless and serves terrain in the highly performant Quantized-Mesh format (also makes terrain lighting available for your meshes).