Bathymetry in cesium

I need to support bathymetry below 1000 meters for a project using cesium. Is there any plan to update the cesium terrain format to support that in the future?

If not, I would like to consider creating a provider to merge bathymetry (and possibly other localized terrain sets) with your terrain data locally rather than hosting an entire high resolution terrain set. Do you see any problem with this approach? Is multi-terrain set support something that in your near term road map?

Hi Keith,

Yes, the final Cesium terrain format will support bathymetry. There are a number of other changes in store for the format as well.

It’s theoretically possible to write a TerrainProvider for Cesium which mosaics together terrain from multiple sources. I don’t intend to implement it myself anytime soon, though, because I think the additional client-side processing time, plus the additional time to download multiple sources from the server, makes it unlikely to be very useful. Plus, there are reasonable server-side solutions to this problem, and those solutions will benefit from caching the result of the mosaic across tiles.



I also need to support bathymetry data. Has there been any progress towards this? Is there a workaround to use it with b23?


There’s still not out-of-the-box support, but I don’t think there’s anything fundamentally preventing it. There are two hurdles:

  1. CesiumTerrainProvider uses a format that supports a minimum height of -1000 meters below the ellipsoid. This is NOT a limitation of Cesium’s terrain engine in general, only of CesiumTerrainProvider in particular. It would be straightforward to create an updated version of it that eliminates this limitation by, for example, using four bytes per height instead of two or by adjusting the height (currently -1000 meters) from which terrain heights are measured. If you haven’t already seen it, this page describes the format loaded by CesiumTerrainProvider, and the source code for the provider is here. I linked to line 58 in the source file, where the height offset and other characteristics of the terrain data are specified.

  2. Cesium uses horizon culling to skip rendering tiles that are below the horizon. With terrain that is supposed to be substantially below the ellipsoid, this could end up erroneously culling tiles that are, in fact, visible. A quick solution is to just disable horizon culling entirely. That check is here. Comment out that line (actually the entire if block) and Cesium will no longer do horizon culling. There will be some performance impact from this, but it shouldn’t be too bad.