Polygon Placement Issue with Cesium World Terrain Enabled

I’m facing an issue with a Cesium Ion KML file import in a CesiumJS viewer. The polygon displays correctly when the WSG84 ellipsoid is enabled. However, when I enable Cesium World Terrain, the polygon goes below the terrain. I’ve provided my Sandcastle code below. Can you please review and help identify a solution?

Here is the my sandcastle link

I’m also attaching kml file which I’m using
testPolygon.kml (505 Bytes)


What is happening is that your polygon is at a fixed height (probably on the WGS48 ellipsoid or just above it). When you switch to Cesium World Terrain, the terrain at that location is now about the height of the polygon.

This should normally be handled by having the polygon classify (ie get projected onto) the terrain instead of being a fixed height. CesiumJS has a known issue with having KML polygons classify terrain.

I’m going to move this post over to the CesiumJS category to see if anyone is able to provide some additional assistance about how to work around it.

Thanks for taking a look.

Could you please inform me about the expected timeline for resolving this Polygon placement issue? Also, will it be addressed in the upcoming Cesium version?

Hi there,

You can have the polygon drape on the existing terrain by passing the clampToGround option as in this example.

The polygon outline, however, will not clamp to ground. As @mdc9001 mentioned, there is an outstanding issue where outlines do not clamp.

I do not have a concrete timeline on when outlines will be addressed, but if you let us know your use case, it could help us prioritize.


Hello Gabby,
I have already used clampToGround property for the coding part in my application.
Now, I need to export this polygon to a game developer who is working in Unreal Engine. The exported KML file works properly on Google Earth, with the polygon already clamped to the ground, but the same file when uploaded on Cesium ION, is not clamped to ground.
So, is there any way that I can export the polygon with the clampToGround property attached in the exported KML file?

Hi there,

The clampToGround option is usually handled at runtime by the engine (or plugin). I’m not sure that it is supported in Cesium for Unreal, but it could be worth checking with the developers in Cesium for Unreal .

One other thing to consider here is also that CesiumJS and Google Earth use different origins for altitude: CesiumJS and other Cesium runtimes use ellipsoid height, while Google Earth uses Mean Sea Level (MSL).

Sure, I’ll check in Cesium for Unreal. Thank you for your support and useful information regarding difference between CesiumJS and Google Earth.