Polygon with extrudedHeight not clampedToGound

Hi,

I am noticing that when I set the extrudedHeight of a polygon from a data source that has been clamped to the ground, the clamping effect is cancelled out and the shape is no longer displayed on top of the terrain.

Is this the expected behavior? If so, any chance of Cesium supporting the combined functionality in the near future?

Thank you,

Ricardo

Hi Ricardo,

Yes, at the moment Cesium only has ground clamping support for polygons with no height/extrudedHeight. It is something we would like to support in the future but we would need to use a completely different rendering method to achieve this, and we have a bit of research to do to figure out the best way to achieve that.

Best,

Hannah

Oh, bummer!

Ok, I should be able to use Cesium.sampleTerrain to supply the elevation data to the polygons. But for performance reasons, I would prefer to perform the sampling as a pre-processing step as opposed to doing it on the fly in the browser.

I went ahead and tried creating a terrain provider in a node.js application (var tp = new Cesium.CesiumTerrainProvider({url : ‘https://assets.agi.com/stk-terrain/world’});), but I am getting the following error: An error occurred in “CesiumTerrainProvider”: An error occurred while accessing https://assets.agi.com/stk-terrain/world/layer.json.

Looks like the only way to invoking the terrain provider is from the browser. I tried installing xmlhttprequest, but I get the same error. Is it possible to sample terrain from a node.js application? Any ideas?

Thank you,

Ricardo

Hi Ricardo,

You should be able to access this from a node application. Maybe try http:// instead of https://?

Has anyone else tried writing a script like this before?

-Hannah

Ok, I was able to make this work using PhantomJS instead of node. For some reason using xmlhttprequest on node would not work for me.

In PhantomJS in order to enable xmlhttprequest to work with a remote service, you need to invoke with command line options as follows:
phantomjs --local-to-remote-url-access=true --web-security=false yoursampleterrainscript.js

If anyone is able to make this work under node, I would really appreciate a reply. Not a show stopper for me at the moment, but it would be nice to be able to do this from within node.

Thank you,

Ricardo