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?
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.
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?
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?
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).