Multi-Terrain Models Displaying

Hi all,

I have a request about multi-terrain models displaying. Could Cesium display more than one terrain model at the same time? In other words, if I have a global 90m resolution DEM data and a local 10m resolution DEM data, could I overlap them in Cesium? Thanks a lot~

Funny you should ask that. I’ve just been revisiting the steps needed to generate a Cesium terrain dataset, and varying resolution is something I may be doing a bit.

Off the top of my head, the answer is “sort of, but not quite how you’re asking”. As far as I know, you can only have a single Cesium terrain provider set at a time, so Cesium will only display the contents of a single terrain dataset. However, because Cesium terrain is a TMS tile pyramid, it’s entirely reasonable to have varying levels of detail within that dataset. So, you might have zoom level 6 for the entire world, but one specific area might go down to zoom level 10 or 11. If you zoom in on that particular area, Cesium would try to request the higher levels of detail.

Appreciate your response. It looks like I should do some preprocessing about the terrain models before display in Cesium. Thanks again~

Yeah, you certainly can’t just take existing dataset as-is and display them. They need to be in one of the two formats Cesium understands: heightmaps or quantized-mesh.

The formats are documented at https://cesiumjs.org/data-and-assets/terrain/formats/heightmap-1.0.html and https://cesiumjs.org/data-and-assets/terrain/formats/quantized-mesh-1.0.html. There’s a nifty open-source utility called “cesium-terrain-builder”, which uses GDAL to read source datasets and write out the heightmap format. It’s at https://github.com/geo-data/cesium-terrain-builder.