Cesium.createWorldTerrain() Offline Environmental Issues

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

@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.

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

I would like to analyze the topography and graph it.

Is there an example to refer to this function?

@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.

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.

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

-Sam

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

@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

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]

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.

1 Like

Is it impossible in an offline environment?

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? :slight_smile:

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

2 Likes

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.

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