Failed to obtain terrain tile X: 0 Y: 0 Level: 0

I’m using the last version of Cesium - Cesium-1.108. I also create terrain myself using Cesium Terrain Builder. As a result of build stage I get data attached to the topic
data.zip (41.0 KB)

It contains all the necessary files, I guess - I see layer.json file there and I see zipped terrain-files. I serve this data using nginx and if I investigate headers, I see that terrain files are returned with these headers: Content-Encoding: gzip and Content-Type: application/octet-stream. So, everything is totally correct - all files are present, all needed headers are also present. And this how my code looks like:

    const viewer = new Cesium.Viewer("cesiumContainer", {
        terrainProvider: await Cesium.CesiumTerrainProvider.fromUrl(`/files/terrain/ee38fd54-4dbb-4dd7-b10e-270475bc5707`, {
            //requestVertexNormals: requestNormals,
            //requestWaterMask: requestWaterMask,
        }),
        //terrain: Cesium.Terrain.fromWorldTerrain(),
        selectionIndicator: false,
        homeButton: false,
        sceneModePicker: false,
        timeline: false,
        animation: false,
        geocoder: false,
        navigationHelpButton: false
    });


    viewer.camera.flyTo({
        destination: Cesium.Cartesian3.fromDegrees(43.970149521784, 54.5302799, 400),
        orientation: {
            heading: Cesium.Math.toRadians(0.0),
            pitch: Cesium.Math.toRadians(-15.0),
        }
    });

So, this error can be easily reproduced. What is wrong with that and how can we fix it?

Actually, I made a public endpoint and this very data can be accessed from here . And this is the page with the example. So, you may try it and check it yourself. It is minimized and reproducible.

Many thanks in advance!

unzip the terrain tiles

Hi, @bertt ! Can you please elaborate on this a little bit? If the header Content-Encoding: gzip is present, why do we need to unzip? And how the folder structure should look like after unzipping?

- 0
    - 0
          - 0
                - 0
          + 0.terrain

Like so?

ah I see now the server has response headers Content-Encoding: gzip. Error reminds me of something with the zip.
Maybe it must be ’ Content-Type: application/vnd.quantized-mesh’, got it from this sample Display a map in Cesium JS

Anyway I normally unzip the terrain tiles, then there are no issues with headers see GitHub - Geodan/terrain

@bertt And as for unzipped files. Am I right, that you unzip initial x.terrain file, then initial zipped file gets removed and you place unzipped content on its place? So, the structure of data remains unchanged

yep

@bertt There is still something wrong. I fixed Content-Type to application/vnd.quantized-mesh. And Content-Encoding: gzip is still there. It can be checked in this link But is still does not work. I have not unzipped content yet, but if I do, it still looks strange that it does not work now.

got it working with unzip

without unzip one option is to use Cesium Terrain Server, or figure out the correct headers

1 Like

Fantastik! Thank you, @bertt !

1 Like