# Cesium- Offline terrain elevation data

**URL:** <https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532>\
**Category:** CesiumJS\
**Created:** [May 18, 2017, 5:18am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532 "2017-05-18T05:18:47Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 18, 2017, 5:18am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/1 "2017-05-18T05:18:47Z")

</div>

Can you please provide me .terrain files? I need offline terrain elevations data.  
I tried accessing this link: [http://sergeserver.dyndns.org/phocadownload/terrain.tar.gz](http://sergeserver.dyndns.org/phocadownload/terrain.tar.gz)

But now it seems the hostname does not exist.

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [May 20, 2017, 6:00pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/2 "2017-05-20T18:00:48Z")

</div>

Hi there,

Here is some sample data for you to try: [https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Specs/Data/CesiumTerrainTileJson](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Specs/Data/CesiumTerrainTileJson)

Hope that helps,

- Rachel

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 22, 2017, 8:19am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/3 "2017-05-22T08:19:01Z")

</div>

Hi,

Actually, for the below code:

var terrainProvider = new Cesium.GeoserverTerrainProvider({

url : “[http://localhost:8080/geoserver/wcs/wms](http://localhost:8080/geoserver/wcs/wms)”,  
layerName: “wcs:clip11(reproject)”,  
waterMask:true  
});  
globe.terrainProvider = terrainProvider;

Where do i get the geoserver folder from?

[The geoserver folder to be hosted at 8080]

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [May 22, 2017, 8:07pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/4 "2017-05-22T20:07:40Z")

</div>

Hi there,

Here is some global terrain data: [https://cesiumjs.org/data-and-assets/terrain/index.html](https://cesiumjs.org/data-and-assets/terrain/index.html)

However, note that it’s free for Internet use, but click on the individual datasets for information on offline terms of use.

Hope that helps,

- Rachel

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 23, 2017, 9:31am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/5 "2017-05-23T09:31:11Z")

</div>

Hi,

When i write below code:  
terrainProvider : new Cesium.CesiumTerrainProvider({

url : ‘[//assets.agi.com/stk-terrain/world](https://assets.agi.com/stk-terrain/world)’

})

I can see map on the globe , but when i write below code:

var terrainProvider = new Cesium.GeoserverTerrainProvider({

url: “[http://localhost:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&tiled=true](http://localhost:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&tiled=true)”,

layerName: “SRTM90”,

styleName: “grayToColor”,

waterMask: true

})

Then i cant see neither map nor globe. Whole screen becomes black when i from switch from ol3 to ol3cesium using below code:

this.map = new ol.Map({

});

this.ol3d = new olcs.OLCesium({ map: this.map });

Why is it coming as black!

---

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [May 23, 2017, 9:36am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/6 "2017-05-23T09:36:35Z")

</div>

Hi,

Have you tested the GeoserverTerrainProvider is working in a pure Cesium application?

Guillaume

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 23, 2017, 10:27am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/7 "2017-05-23T10:27:23Z")

</div>

Hi,  
No, I havent tested ‘GeoserverTerrainProvider’ on a pure cesium app.

Actually my app is not purely cesium app, my app should support both ol3 and ol3cesium/cesium.

So, i have made a button, which allows switching from 2d to 3d mode (i.e. ol3 to ol3cesium mode). But now in the 3d, i.e. ol3cesium globe mode, I have to show elevations using offline data. For which i made the geoserver setup done.

But now the problem is coming up that earlier i was able to see the map using :

source: new ol.source.Stamen({

layer: ‘terrain’

})

map in ol3 and when switching to ol3cesium i was able to see elevations using:

var terrainProvider = new Cesium.CesiumTerrainProvider({

url: ‘[https://assets.agi.com/stk-terrain/world](https://assets.agi.com/stk-terrain/world)’

});

scene.terrainProvider = terrainProvider;

BUT, now when i switch to ol3cesium i see blank screen , i cant see globe when i use:

var terrainProvider = new Cesium.GeoserverTerrainProvider({

//url: “[http://localhost:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&tiled=true](http://localhost:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&tiled=true)”,

layerName: “SRTM90”,

styleName: “grayToColor”,

waterMask: true

});

Thanks.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [May 23, 2017, 11:45am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/8 "2017-05-23T11:45:09Z")

</div>

Hi,

Yes I understand your use case, I am the main dev of OL-Cesium.

Making sure the problem is not a pure Cesium bug would help analyze your issue.

Guillaume

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 23, 2017, 12:17pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/9 "2017-05-23T12:17:46Z")

</div>

Hi Guillaume,

I solved the blank black screen problem by changing the code as below:

var globe = new Cesium.Globe(Cesium.Ellipsoid.WGS84);

var terrainProvider = new Cesium.GeoserverTerrainProvider({

url: “[http://localhost:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities](http://localhost:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities)”,

//layerName: “SRTM90”,

//styleName: “grayToColor”,

waterMask: false

});

globe.terrainProvider = terrainProvider;

Am not sure if this is the correct way though.

BUT, i cant see any elevations ! What am i missing?

Please guide.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [May 23, 2017, 3:10pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/10 "2017-05-23T15:10:14Z")

</div>

Don’t know.

Have you considered using [https://github.com/geo-data/cesium-terrain-builder](https://github.com/geo-data/cesium-terrain-builder) instead?

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 24, 2017, 12:17pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/11 "2017-05-24T12:17:18Z")

</div>

I am trying to install cesium terrain builder, but getting an error of wanting gdal version 2.0.0 during setup.

I think using ctb i can convert .tif to .terrain and then use those .terrain files in my app. Right?

---

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [May 24, 2017, 12:19pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/12 "2017-05-24T12:19:16Z")

</div>

Yes

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [May 26, 2017, 4:02am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/13 "2017-05-26T04:02:18Z")

</div>

Hi Guillaume,

I have got the elevations of a particular region by hosting the .terrain files on a local server on my machine by below code:

var terrainProvider = new Cesium.CesiumTerrainProvider({

url: ‘[http://localhost:8080/terrain/terrain\_52\_06](http://localhost:8080/terrain/terrain_52_06)’

});

this.scene.terrainProvider = terrainProvider;

But now i dont want it from “server”, but read directly from the local filesystem without server then what should be the code ?

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [June 7, 2017, 9:32am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/14 "2017-06-07T09:32:43Z")

</div>

> > Please guide…

How to read directly from the local filesystem without server. What should be the code ?

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [June 8, 2017, 2:05pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/15 "2017-06-08T14:05:59Z")

</div>

The files must be hosted on a server in order for Cesium to access them – this is just a general security feature of the browser.

Hope that helps,

- Rachel

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [June 9, 2017, 7:21am UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/16 "2017-06-09T07:21:51Z")

</div>

Hi Rachel,

My web app is already hosted on node server at 3005. So i wrote below code:

var terrainProvider = new Cesium.CesiumTerrainProvider({

url: ‘./app/map/terrain\_52\_06’

});

this.scene.terrainProvider = terrainProvider;

I get to see elevations of that one area. BUT i can also see unwanted elevated spikes all over remaining world.

What could be the issue?

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [June 9, 2017, 9:20pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/17 "2017-06-09T21:20:54Z")

</div>

Hi there,

It looks like this might be either a server configuration problem, or a problem directly with your tileset. Unfortunately, this isn’t enough information for us to help you diagnose your problems. I would recommend checking the rest of your setup, because I’m not sure this is a directly Cesium issue. If you narrow it down a little more, perhaps we could help answer more specific questions.

Hope that helps,

- Rachel

---

<div class="post-metadata">

**Author:** ![nigamricha17](https://avatars.discourse-cdn.com/v4/letter/n/90ced4/32.png) [@nigamricha17](https://community.cesium.com/u/nigamricha17)\
**Post date:** [June 11, 2017, 2:47pm UTC](https://community.cesium.com/t/cesium-offline-terrain-elevation-data/5532/18 "2017-06-11T14:47:26Z")

</div>

Actually my app is running on node server (port 3005) and when i host terrain elevation data on tomcat (port 8080) and enable CORS, I get to see perfect elevations of my one area.  
But when i don't use tomcat and host data from node server (port 3005) using code shared before, I can see unwanted elevated spikes.
