Any ideas? Rendering a path of an object with 70,000+ positions causing performance issues.


I'm generating a simple CZML file which just has 1 packet. The packet contains a point, a path, and a position (cartographicDegrees). There are about 70,000 position values (time, lat, lon, alt) in it.

Everything renders great when I just have the position and the point in the packet. When I add the path, performance severely drops and the path is rendered very distorted and choppy. (the polylines don't connect, etc)

My guess is Cesium is rendering about 35,000 polylines which is killing performance.

Is there a better way to render a path for CZML with this many positions?

I don't want to "skip" positions and rely on interpolation so I need a way to show every one of my positions.

Is there a way to render the path as a bunch of points rather than polylines (creating some kind of custom drawer)? If so, how? Do you think that would still cause the same performance issues?


Another question I just came up with. If the path element is drawing polylines to connect the positions, why do zig zag back and forth rather than just connect 1 position to the next?

I loaded up the czml and zoomed into the path to see a bunch of zig zaggy lines. I drew my own polyline right next to it and it was completely straight.

Also, is there a way to highlight the points in the path?


For this much data, you may want to use the new geometries (tutorial) directly until CZML is also using them (roadmap, branch). This will work well for static data, e.g., if the polylines aren’t moving. Dynamic data should be handled separately, for example, with the billboard collection.

For styling a polyline see this example and the material tutorial.

The zig-zagging sounds like a bug. If you can provide a CZML sample, we’ll submit an issue.



Thanks Patrick. Could you explain why drawing polyines with geometries would be a performance improvement over drawing the "old" polylines?


The PolylineCollection is meant for general use so it provides OK performance for many use cases, but it is not as fast a specialized code. The Cesium geometries are specialized for drawing a large number of static objects as described at the start of the tutorial.


Your suggestion worked great. Using the geometries libraries lets me plot as many polylines as I need with great performance. Thanks!