google earth terrain with cesium


in the company that i works we thinking about migrating our ui map from Google earth plugin to cesium

the problem is that we must use Google earth as the server side (for imagery, vectors and terrain)

Another issue is that we using the enterprise edition and our products must work offline.

For the imagery its pretty simple with the new provider that you added (thanks for that :))

but for the terrain i didnt find any good solution

I’m thinking about three solutions:

  1. is it possible move our data from srtm/dted/ any other standard format to .terrain and work with cesiumTerrainProvider

  2. create GETerrainProvider (i dont know if its possible)

  3. i saw that there was WebMapServiceTerrainProvider (I cant find it now) and i know that the new enterprise version support this.

If there is no open source solution, the company that i works willing to pay for that feature.

And now for the question

What are my options?

thanks in adavance



on my side, I have been working on developing a Cesium terrain provider, compliant with the format described in the Wiki (

It almost works, but I have a question on the file format for the water mask. The end of the file represent this water mask. If the tile is 100% water or land, ok, I understand. But if this is a mix of water and land, I have a problem. The file represents a part of earth, whose size is 65 x 65 cells, but the size of land /water mask is 256 x 256 x 1 bytes. What is the relationship between the height / width of 65 and the dimension of the mask? Is the water mask more precise than the cell, does the water mask overlaps with the neighbor cells?

Hey Matyz,

I’m not sure if the Google Earth terrain format is documented. If it is, or if someone is willing to do the necessary reverse engineering, I suspect it would be possible to write a custom TerrainProvider in Cesium to use it. I don’t know if the Google Earth Enterprise terms of service will allow such a thing, and I don’t have access to a GE server anyway, so I’m afraid I can’t help with that.

Regarding question #1, I am currently working on a server product that will make it trivially easy to drop in your SRTM, DTED, etc. data and prepare it for use with Cesium. It will be a commercial product sold by the biggest sponsor of Cesium development, AGI. We hope to make it available publicly in January. I’ll be sure to let you know when it is available.

Regarding question #3, we used to have a WebMapServiceTerrainProvider, but got rid of it almost a year ago because it was unfinished and fairly difficult to work with. The problem with terrain from WMS is that WMS likes to serve images in formats like TIF, PNG, and JPG. PNG and JPG generally only support one byte per pixel component, and one byte is not enough to accurately represent terrain. Meanwhile, TIF has enough precision, but most browsers can’t decode TIFs, which makes it difficult for Cesium to use them. So our previous WebMapServiceTerrainProvider accessed TIFs by first passing the request through a custom server-side proxy. The proxy decoded the TIF, and re-encoded it as a PNG where all three colors in each pixel were used to represent a 24-bit integer, and that integer (with an appropriate scaling factor) was used as the height. Pretty ugly. If you need to go this route, I can dig up that old code for you to use as a starting point.


The water mask is more precise than the terrain; there is no additional overlap. The reason is that the water mask acts more like imagery than terrain. A 65x65 water mask in a 65x65 terrain tile would look obviously blocky.

first thanks for your quick response.
second, in order to make things clear for me,

if i’m interesting in working offline, with my terrain data, using cesium terrain provider, i will have to create some web server (let say nodejs),

that contains the converted terrain files on it

and on the client side all i have to do is to create new cesiumTerrainProvider

like this:

var terrainProvider = new Cesium.CesiumTerrainProvider({

    url : ''my ur' 


where the url is mapped to my server

am i right ?

That’s right. One subtlety is that if the node.js server is not the same one that is serving the HTML page that includes Cesium, then it will also need to include CORS headers in order to allow Cesium to access it.


Thank you very much for this response.