Polygon with holes and clamp to ground features.


I’m working on migration a project from Google Earth API to Cesium. I’ve found that Cesium is great for that purpose. After reading Cesium documentation and doing proof of concept application, I still have 2 questions:

  1. how to handle complex polygons in kml. Application uses KML with definitions of inner and outer rings. After loading kml document, the holes are not being visualize properly (i can see transparent triangles). I tried to generate and use CZML format but results are the same. Does CZML/KML datasources support polygons with holes?

  2. is there support for Google Earth clamp to ground parameter in KML, or alternative in CZML?

Thanks and regards


Hello Pawel,

What kind of project are you working on? Glad to hear you’re liking Cesium so far!

We have an open issue for the polygon triangulation problem. You can see it here: https://github.com/AnalyticalGraphicsInc/cesium/issues/3044

I’ll add a link to this post from the issue. Do you have a sample KML file you could send over? That will help us make sure it is fixed once someone looks into the problem.

We recently added support for ground primitives to the Primitive API, but it hasn’t been piped up through to the Entity API. KML is rendered using the Entity API, so we don’t have support for clamp to ground for KML yet. Once we have support for polylines on terrain, we will connect all of the clamp to ground support to the entity layer.



Thanks for such a quick response.

The project I’m working on is meant to show cellular network data, such as coverages of signal based on technologies, topological data of network structure and other useful information.

Below I have added sample pictures presenting described issue. There is also a sample .kml file.

As I understand:

  • triangulation problem that You have described does not corespond stricly to KML files but all dynamic datasources. Correct me if I’m wrong. I’ve read about polygon hierarchy in Entity API. As a result I assume that creating polygons with holes is possible using javascript library but there is no out of the box support for KML or CZML yet.

  • second feature is waitig for integration

Could you tell me when those features will be available in Cesium. I mean weeks, months or maybe there is some kind of a road map?



W dniu wtorek, 22 grudnia 2015 16:30:48 UTC+1 użytkownik Hannah Pinkos napisał:

sample.kml (232 KB)

Thanks Pawel! I’ve attached your KML example to the GitHub triangulation issue.

Yes, the triangulation problem is a bug on our end. Our current algorithm for triangulating polygons fails for polygons with complex holes.
I’m not sure when someone will be able to look at it, but since several users have reported this bug it will hopefully be addressed soon. Part of the problem is we need to make sure any new algorithm runs as efficiently as our current one, otherwise it would slow down the render time for users with massive polygon data sets.

And yes, the second feature is waiting on integration. We want to have all types of vector data on terrain implemented before we connect it to the Entity API. The last thing we’re waiting on is polylines. It’s a surprisingly difficult problem to solve, and there’s a bit of research that needs to be done to figure out the best way to implement it. For a very rough estimate, it will likely be within the next year, but unlikely that it will be in the next few months. We have a roadmap issue here: https://github.com/AnalyticalGraphicsInc/cesium/issues/2172

If you wanted to make the modifications to the code so just polygons render on terrain, I don’t think it would be too complicated. Let me know and I can point you to some resources.