Custom Terrain Data - Causing Globe to Not Render

Hi all,

I’ve hit quite the roadblock seeking assistance. I’m trying to import COP30 DEM so I can host it locally with quantized-mesh-builder.

Using v1.126

My build commands as follows

convert to single optimised TIFF

docker run --rm -v “$HOME/terrain-data”:/data osgeo/gdal:ubuntu-full-3.6.2
gdal_translate -of GTiff -co TILED=YES -co COMPRESS=DEFLATE -co BIGTIFF=YES
/data/input/mosaic.vrt /data/input/mosaic_tiled.tif

Build pyramids

docker run --rm -v “$HOME/terrain-data”:/data osgeo/gdal:ubuntu-full-3.6.2
gdaladdo -r average /data/input/mosaic_tiled.tif 2 4 8 16 32 64

generate tiles - all at once

docker run --rm -v “$HOME/terrain-data”:/data tumgis/ctb-quantized-mesh
ctb-tile -f Mesh -c $(nproc) -s 13 -e 0 -o /data/output -v /data/input/mosaic_tiled.tif

Using geoserver to host static files as I will need it in future. I have also tried http python and nginx with same results.

If I use CreateWorldTerrain instead, the globe renders just fine.

                // Set the terrain provider
                viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
                    url: 'http://localhost:8080/geoserver/www/terrain/',
                    requestVertexNormals: false,
                    requestWaterMask: false,
                    getTileDataAvailable: getTileDataAvailable
                });
                
                console.log("GeoServer terrain initialized");
            })
            .catch(error => {
                console.warn("Using Cesium World Terrain instead:", error);
                // Use Cesium's built-in terrain as fallback
                viewer.terrainProvider = Cesium.createWorldTerrain({
                    requestVertexNormals: true,
                    requestWaterMask: false
                });
            });

I don’t really have a method to check the validity of the output ctb commands, and first time using this data type. I am quite suspicious that the files are only approx. 1KB in size
{
“tilejson”: “2.1.0”,
“name”: “mosaic_tiled”,
“description”: “”,
“version”: “1.1.0”,
“format”: “quantized-mesh-1.0”,
“attribution”: “”,
“schema”: “tms”,
“tiles”: [ “{z}/{x}/{y}.terrain?v={version}” ],
“projection”: “EPSG:4326”,
“bounds”: [ 0.00, -90.00, 180.00, 90.00 ],
“available”: [
[ { “startX”: 1, “startY”: 0, “endX”: 1, “endY”: 0 } ]
,[ { “startX”: 3, “startY”: 0, “endX”: 3, “endY”: 0 } ]
,[ { “startX”: 6, “startY”: 1, “endX”: 7, “endY”: 1 } ]
,[ { “startX”: 12, “startY”: 2, “endX”: 15, “endY”: 3 } ]
,[ { “startX”: 25, “startY”: 4, “endX”: 30, “endY”: 7 } ]
,[ { “startX”: 51, “startY”: 8, “endX”: 60, “endY”: 14 } ]
,[ { “startX”: 103, “startY”: 16, “endX”: 120, “endY”: 28 } ]
,[ { “startX”: 207, “startY”: 32, “endX”: 241, “endY”: 57 } ]
,[ { “startX”: 415, “startY”: 65, “endX”: 483, “endY”: 115 } ]
,[ { “startX”: 830, “startY”: 130, “endX”: 967, “endY”: 230 } ]
,[ { “startX”: 1661, “startY”: 261, “endX”: 1934, “endY”: 460 } ]
,[ { “startX”: 3322, “startY”: 523, “endX”: 3868, “endY”: 921 } ]
,[ { “startX”: 6644, “startY”: 1046, “endX”: 7736, “endY”: 1843 } ]
,[ { “startX”: 13289, “startY”: 2093, “endX”: 15473, “endY”: 3686 } ]
]
}

:~/geoserver-docker/terrain-data$ ls
0 1 10 11 12 13 2 3 4 5 6 7 8 9 layer.json
t:~/geoserver-docker/terrain-data$ cd 0
:~/geoserver-docker/terrain-data/0$ ls
1
~/geoserver-docker/terrain-data/0$ cd 1
0.terrain

891 bytes (891 bytes)

hexdump 0.terrain
0000000 8b1f 0008 0000 0000 0300 58ed 6bcd 5113
0000010 ff10 924d 867e 5bb2 65fb 769b d0db 20e4
0000020 3d1e 5549 22ac 28ad 8ab4 071f 0a0f f67a
0000030 17a8 93c1 de82 428a a0ad 1547 f414 f01f
0000040 57a4 0505 4915 2b45 3d68 a0a9 2f07 9d6d
0000050 dbf7 64dd 7663 b49b 10e6 beeb fde1 3266
0000060 de6f eccc f37b 10e6 38a0 df76 3239 8e39
0000070 58c0 7d98 17b7 eb11 e7e7 170a 6cde e13b
0000080 fefd e2b5 eff2 fd17 59df 9601 bb55 c162
0000090 b15e 2a0c 1281 49bc af8d 54a7 6ebe 5d86
00000a0 d8d4 fd25 b592 556c 75ee e7a7 d437 fae7
00000b0 99e3 65a5 f24f 1b63 f74b 52f7 9ec8 f7c0
00000c0 d471 c712 2b5f 67e6 7e97 f6b9 6b95 ffae
00000d0 3462 ef44 e3f1 6d19 afb8 c435 cbb1 dd4f
00000e0 c2ff 33b2 dd2d bd83 556c e6e6 5215 ef95
00000f0 9c08 4561 9aa4 0933 79b9 6466 e9ff 86a9
0000100 d6cc 2f19 d2aa ba02 a2b8 a957 5284 96d5
0000110 44e2 7255 16d0 e391 f3b5 79ca f53a 2a64
0000120 357c a101 afc3 5b2b 4d73 cf8f db9e b292
0000130 1e66 1e25 a226 c5fd 6363 e38e 8349 91e2
0000140 195f 8482 2727 4d3c a8b2 784f a2ab 94ba
0000150 8a62 533b f621 6f49 6b97 a295 a4dc 44d8
0000160 9a04 5b15 8494 f7dc eeef 6214 9f30 5c60
0000170 b3b3 3699 91cd 6d36 6d8a 69b4 bb43 3b62
0000180 76e5 15a4 94d3 55d3 7672 14f3 db2f dcf0
0000190 fad6 e9bd ec62 f9fa 54ec 7212 9741 f192
00001a0 c5d0 c5d9 e8d3 4d56 928f fb90 2b71 aeef
00001b0 0cf2 bc5b 319b aad8 4ad8 b5b9 6cec feff
00001c0 eb0c bf7b 3c5d 2105 5a36 436e 438a 8794
00001d0 28e0 943a 641d b315 b394 cf9e 3164 df0f
00001e0 a8ff 28e2 a375 29c8 28e6 90e7 cc57 ce53
00001f0 f957 5ade dade 6b5a 43af c849 9605 f192
0000200 7160 3c5a 1b0d f5e5 68d9 f7b5 bcaf 7cdf
0000210 8ef1 33e3 ef5c 6e19 1257 c172 9298 3cf1
0000220 39c6 b8c6 543b ae33 e424 6e7e de4d 1bd7
0000230 be0c e0fd aed9 f39e 253e 1721 284c cb19
0000240 ce09 e609 a936 fd9a 424a 8f5e 35fb d0ef
0000250 6ca2 5c35 ec0f ec57 dca7 018f 01c5 03ca
0000260 bd65 aa31 0e07 0e2b 3753 118c 11c5 23ca
0000270 fd21 ee33 1b81 fdef 3dc6 6370 c0f7 2519
0000280 8f21 607b 03dc f7e3 f71b ffc0 07af 55be
0000290 7212 4141 78c9 7028 9816 bcdb 166a 8494
00002a0 5abc e66e fa35 72ef dcf5 293e b909 5160
00002b0 58c9 722e 322e 2fb7 59aa 1252 7af2 9ed4
00002c0 27f9 ffc2 a24f b157 7297 596f 8c6f 81ea
00002d0 c519 750c 0c19 0e2a 1e52 e90c 8d9f 03d6
00002e0 a43b 6843 68a3 2589 b3c6 4925 26ca adae
00002f0 3e9a a3e9 c18d d57a 465e f432 d069 4711
0000300 a58c 0923 26ca 61b7 64d5 53a5 1ba5 c398
0000310 dc4d 6dc2 c5dc dc3d 03c7 c33c bc73 4bc0
0000320 c0ad bc79 07c7 2b18 5f28 47c0 97ad f8cf
0000330 ef86 81f8 e89f 4d94 23d2 32bd 3ea4 c447
0000340 72b5 a02b 5f55 375f b0fa 3b19 4bb1 d4df
0000350 1c1e 41c0 614c be9a 71a6 8708 1471 70c7
0000360 a712 1a70 7067 9709 0571 7157 d70d ab31
0000370 fd19 3006 3477 c8ff 001b 0000
000037b

This is also the case for the higher resolution 13

Hi @unknownwanderer ,

Thanks for your post and welcome to the Cesium community.

1KB sounds quite small relative to the DEM data you started with. I am not clear from your description if that is the single optimized tiff, pyramid, or tiles…, but whichever it is I would suggest starting at that step for debugging. Some early guesses based on past experience would be source data inconsistencies - in which case you may need to run a cleaning step - or adjust cli parameters.

Please let us know if you have further questions as you continue to work on creating this terrain dataset.

Best,
Luke

Thanks for the reply Luke, managed to figure this out.

I had to use Nginx w/ content-encoding gzip header. The cesium-terrain-server build hasn’t been updated and not working.