Cesium Terrain Data

Hello all,

About 10 months ago, I had done some work to gather a bunch of SRTM data and convert it to a format that is usable by Cesium. We set up a custom terrain server and we were able to serve and view our custom terrain tiles.

More recently, the need for a custom terrain server has come back and what I had worked on is finally being put to use. We have encountered some problems that we were not getting before, however. I believe our terrain server is setup correctly, but we are getting errors when trying to load in custom terrain. We are working with Cesium-b28 on a Windows 7 machine (previously we were working with b18). I am assuming there have been changes to the Cesium source code, possibly the Cesium terrain tile format, and perhaps the CesiumTerrainProvider since then.

I have created a Sandcastle example that is a modified version of the Terrain example. It sets up a new CesiumTerrainProvider and sets the url to the path of the terrain data on my server.

I am getting the following error when trying to use a custom terrain provider:

"An error occurred in "CesiumTerrainProvider": An error occurred while accessing http://[machine address here]/Apps/TerrainData/layer.json."

It seems to be looking for a file "layer.json" that I do not have inside of my TerrainData folder. I did not have this previously (10 months ago) and everything worked fine. What is this file? Is there an example that I can look at to create one myself?

I wish I could provide a screenshot of the contents of the TerrainData folder. Basically it contains 0-9 folders, a doc.kml, openlayers.html, and tilemapresource.xml, but no "layer.json".

Thanks a lot in advance!

A lot has changed in 10 months. Thankfully, the error you see is just a warning; the layer.json file is not required for old versions of the terrain data.

Okay thanks Alexander, good to know. The other error I've been getting is
"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."

The thing I can't figure out is why I am seeing this error now. I am using the same terrain data as I did in the past. I am not sure what the X and Y stand for.

To clarify, I do indeed have a 0/0/0.terrain file and a 0/1/0.terrain files (among others of course).

Ah, I suppose the errors I was seeing was for other tiles I had not provided. I was also using an internal path to our server, which was giving problems. I am able to see terrain, even with these errors.

I saw this same error when we upgraded our application from b17 to b29 a couple weeks ago. It seems that while the .terrain file format has stayed the same, they’re now expecting a static “layer.json” file to exist at the root of the terrain folder containing metadata on whether the terrain data is in the heightmap format or the new quantized-mesh format.

If you look in the Cesium source at the CesiumTerrainProvider implementation, you’ll see that it first tries to grab layer.json. If that request comes back as 404, it defaults to assuming that the terrain data is in heightmap format without a metadata file, and uses a default set of metadata. Note that it won’t actually try to download terrain files until that layer.json request has resolved. Your best bet is to copy that default metadata definition and save that into your terrain folder as layer.json.

u any solution from this problem.pls guide us