Hello,
I need to store the results of sampleTerrain() in a file.
Currently, I can only execute this function with JavaScript whereas all of the supporting code I have is in C# .NET.
Is it possible to query this function outside of JavaScript?
Thanks,
Nick
omar
February 20, 2019, 3:06pm
2
There does exist an ion REST API but we’re currently working on documenting it. In the mean time, you could go in the network tab of your CesiumJS application, find the request it’s making, and then make that request yourself with your asset token in C#. The request URL will look something like:
https://assets.cesium.com/1/11/1207/1489.terrain?extensions=metadata&v=1.2.0
``
Where the first 1 is the asset ID (which is Cesium World Terrain in this case), and then I believe it’s followed by level, x and y.
Do note that downloading content from ion for offline use may be against the terms of service:
Cesium is geospatial. Use Cesium ion's simple workflow to create 3D maps of your geospatial data for visualization, analysis, and sharing. For developers, use the open-source CesiumJS library to create custom 3D mapping apps.
But as long as you’re requesting it on every session/use then that should be fine.