# Cesium.createWorldTerrain() Offline Environmental Issues

**URL:** <https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668>\
**Category:** CesiumJS\
**Created:** [October 13, 2021, 12:51am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668 "2021-10-13T00:51:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 13, 2021, 12:51am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/1 "2021-10-13T00:51:59Z")

</div>

Hello

I’m trying to implement a cross path in cesium.  
When you run the “Cesium.createWorldTerrain()” function in an offline environment, the “\_availability” attribute is displayed as undefined.

There is a problem in implementing a cross path due to this problem.

Is there a solution?

![image](https://global.discourse-cdn.com/cesium/original/2X/1/10d002e0a0419be60ef86455995bd8bd5bddc614.png)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [October 15, 2021, 3:38am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/2 "2021-10-15T03:38:20Z")

</div>

@giyoonkim

Welcome to the community! What exactly do you mean by a cross path? We put together a demo that can help users get started with CesiumJS offline.

> **[Cesium Sandcastle](https://sandcastle.cesium.com/?src=Offline.html)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

I suggest you use this code as a reference when building your offline application. You will of course need to provide a URL that links to a file that is stored or hosted locally. Please let me know if you have any other questions or concerns. I am looking forward to learning more!

-Sam

---

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 15, 2021, 6:45am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/3 "2021-10-15T06:45:29Z")

</div>

I would like to analyze the topography and graph it.

Is there an example to refer to this function?

 ![image](https://global.discourse-cdn.com/cesium/original/2X/b/bda0f183bd69125680eb19cbd034f601a73a1040.jpeg)

 ![image](https://global.discourse-cdn.com/cesium/original/2X/e/e63e14ab527eb64a4c9ccb03fef2d8264b4be233.png)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [October 18, 2021, 3:38pm UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/4 "2021-10-18T15:38:30Z")

</div>

@giyoonkim

Thank you for sharing some more information about your use case. As far as I know, we do not have a function in our API that will automatically graph elevation data over a given polyline. However, the following demo showcases how to add a polyline to the top of a 3D Tileset.

> **[Cesium Sandcastle](https://sandcastle.cesium.com/?src=Sample%20Height%20from%203D%20Tiles.html&label=3D%20Tiles)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

This demo also showcases how to get the height of the polyline at various locations. In terms of visualizing the data that you will retrieve from our API, I did a little bit of research and it seems like ploty is a great graphing API.

> **[Plotly](https://plotly.com/javascript/)**
>
> A

Let me know if you have any other questions or concerns! Your project seems really cool 😁 I am looking forward to seeing your progress.

-Sam

---

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 21, 2021, 8:16am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/5 "2021-10-21T08:16:46Z")

</div>

Thank you for your answer.  
I referred to the api, but the data I need is data converted into longitude, latency, and height values.

Problems arise in the process of converting as shown in the image below.

##In an offline environment.##

The main problem is…  
“Cesium.createWorldTerrain()”  
I think it’s a function.

The attribute value of “\_availability” included when calling the “Cesium.createWorldTerrain()” function is called undefined in an offline environment.

Is there a possibility of solving it? Thank you very much for your sincere response. Good luck.

![image](https://global.discourse-cdn.com/cesium/original/2X/3/35cb56f157421658903f8b35f2706e081a9ff10b.png)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [October 21, 2021, 6:48pm UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/6 "2021-10-21T18:48:14Z")

</div>

@giyoonkim

I took some time to look through the code snippet that you shared. Overall, some more context and details about your code would be helpful. For instance, where is the variable `crossPositions` being updated? I am looking forward to learning more!

-Sam

---

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 21, 2021, 11:58pm UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/7 "2021-10-21T23:58:36Z")

</div>

![image](https://global.discourse-cdn.com/cesium/original/2X/d/d7fbb9adc9394b7e8f30670d9b945b61ad896d58.png)

This is the cross positions information you mentioned! Thank you for your interest!

Additionally, before executing the “sampleTerrainMostDetailed” function, the height values in the array are sequentially reduced.

After executing the “sampleTerrainMostDetailed” function, it appears to be converted to the height of the 3D tile.

Please keep that in mind!

[Data after conversion]

 ![image](https://global.discourse-cdn.com/cesium/original/2X/b/bcf0f16e709ce7695105fd2bf0bcc378473f6ab3.png)

---

<div class="post-metadata">

**Author:** ![henryqng](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/henryqng/32/1987_2.png) [@henryqng](https://community.cesium.com/u/henryqng)\
**Post date:** [October 23, 2021, 1:58pm UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/8 "2021-10-23T13:58:04Z")

</div>

I think the issue was calling the method Cesium.createWorldTerrain() in an offline environment. You need to have active internet connection and Cesium ION accounts for the above method to work correctly.

---

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 25, 2021, 12:04am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/9 "2021-10-25T00:04:19Z")

</div>

Is it impossible in an offline environment?

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [October 25, 2021, 12:13am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/10 "2021-10-25T00:13:51Z")

</div>

Hmm. Not impossible, but also not simply out-of-the-box. Using Ion assets is a SaaS thing, so to make a cached version of that sounds tricky (but not impossible) where you’d have to catch all tiles (there’s an event hook for that), go through your cache and save those files locally, then recreate the thing on demand.

There’s also questions like if this has to be available world-wide, or a bounded area? No matter which way, you need to find a way to have local access to the data. The terrain in question lives online (for good reasons; having a local version of the worlds terrain is in the terrabytes of data), so not sure how you can expect it to work offline? 🙂

However, if you know your bounds and you want to set it up, there might be ways to save a local cached version of the tiles for that area locally. As I said, it’s not out of the box, but also not impossible, it comes down to time and effort.

Maybe some more details around this accessibility and needs would be a good start.

Cheers,

Alex

---

<div class="post-metadata">

**Author:** ![giyoonkim](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/giyoonkim/32/6705_2.png) [@giyoonkim](https://community.cesium.com/u/giyoonkim)\
**Post date:** [October 27, 2021, 12:37am UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/11 "2021-10-27T00:37:18Z")

</div>

Thank you so much for identifying the exact problem.

You don’t need it worldwide, but you only need to be able to do the work area.

If you don’t mind, can I ask for an example or a guide?

Thanks once again.

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [October 31, 2021, 11:55pm UTC](https://community.cesium.com/t/cesium-createworldterrain-offline-environmental-issues/15668/12 "2021-10-31T23:55:31Z")

</div>

Can’t really help you much on this one, we never use Cesium offline so never had the need to venture into that world. And I also think that if you’re going offline, maybe look into the Cesium Unreal engine instead? The whole point of a browser is the internet, but if you’re not really using internet, maybe Unreal is a better option?

Cheers,

Alex
