Terrain Tiler

Tile raw terrain data for streaming with Cesium ion's Asset Server.

Setup

Extract the contents of Cesium-ion-3D-Tiling-Pipeline.zip.

The main executable is terrain-tiler and can be found under bin.

Windows

Windows binaries require Visual C++ Redistributable for Visual Studio 2017. Download and run the installer.

Using the tiler

The Cesium ion terrain tiler outputs a terraindb file that can be streamed over the web using the Cesium ion Asset Server.

To tile a terrain file, run the following.

bin/terrain-tiler -i Terrain.tif -o Output.terraindb

We can also pass multiple files as input.

bin/terrain-tiler -i Terrain0.tif Terrain1.tif -o Output.terraindb

If some terrain files are overlapping, the tiler will layer files earlier in the list above those later in the list.

If the input data is not in WGS84 (EPSG:4326), the terrain tiler will automatically reproject it.

Available options

Below is a full list of command line options to configure the tiler.

Option Description Required Default
--help, -h Display help message.    
--version, -v Display version number.    
--input, -i One or more terrain files to be tiled into a single layer. For overlapping terrain files, files earlier in the list are layered above those later in the list. Input must be single band. Most raster formats are supported. We’re always adding support for more so don’t hesitate to reach out if you found something that’s incompatible.  
--output, -o A directory to output the terrain tileset. This will overwrite existing content or create a new directory if it does not exist.  
--attribution, -a Custom attribution string that will be stored in the final tileset.    
--quiet Suppress output during tiling.   false
--verbose Show verbose output.   false
--height-reference, -r Specifies what the input elevation values are relative to. Set to Ellipsoid to use the WSG84 ellipsoid or MeanSeaLevel to use the EGM96 model.   MeanSeaLevel
--source, -s Path to a .terraindb file to use as the base terrain layer. The output will contain only tiles that differ from this source.    
--void-fill, -f Configures the default value to use when encountering void elevation values. Set to MeanSeaLevel to use the EGM96 model or Underlying to use elevation values from underlying terrain layers (or the EGM96 model when no underlying terrain layers exist).   Underlying
--water-mask, -w Set to true to treat elevation values at sea level as water. This will add a water mask to the terrain tileset that CesiumJS will use to display water.   false

Next steps

Now that we’ve tiled our terrain, the next step is to stream it into CesiumJS. Terrain can be served with the Cesium ion Asset Server. We can then supply a URL to our terrain as shown below.

var viewer = new Cesium.Viewer('cesiumContainer', {
    terrainProvider : new Cesium.CesiumTerrainProvider({
        url : '<URL-To-Terrain-Server>'
    })
});

The Hosting 3D Content tutorial walks you through setting up the Cesium ion Asset Server and streaming your terrain with CesiumJS.

License

Third-party licenses used by the tilers can be found in LICENSE.json.

Community Support

Cesium has an active community of developers and users. Along with members of the Cesium team, they support all kinds of technical questions.

Ask the forum