Does Cesium.js Entity Polyline "compress" positions?

Hi, friends,

Does the polyline entity in Cesium.js could compress position? If the polyline has many positions, for example, about 20000 or more 50000 etc, does the entity have the ability to compress this positions? or it may collapse? Some of these points are not far away from each other, or has the same direction, if it will make the browser collapse , maybe I have to “compress” these position bymyself, but dealing with the direction and distance of so many points is quite time-consuming, so could you tell me if Cesium could do such things so that I could ignore these hidden dangers?

Thank you.

I think what you’re describing is often referred to as simplification (in a one-off case) or level of detail (LOD) when done incrementally based on viewing distance or performance needs. Polyline entities render the geometry as provided, and do neither of these on the fly.

Vector Tiles are an upcoming goal in CesiumJS — while the GitHub issue appears quiet, it is an active area of work. The approach there is to compute efficient levels of detail offline, and thus to support arbitrarily-large collections of points, lines, and polygons. I would recommend subscribing to that issue for updates in the coming months.

If you have highly dynamic data and won’t have the option of tiling, then I would consider the newer BufferPolylineCollection class. This is similar to a collection of Polyline entities, but optimized for much larger datasets, and it’s an underlying piece of the upcoming Vector Tiles work. 50,000 polylines should be no problem for performance with this approach, unless the individual lines themselves are very complex.

Thanks for your help.

BufferPolylineCollection maybe good fit. But probably I didn’t speak clearly, the problem is many positions in just one line , not many polylines in a collection.

Ah I see — sorry I misread! I believe the answer is the same, though, either of the above solutions should work. Or a small number of regular Polyline entities might be OK at this scale — that is worth trying if you haven’t already.

Thank you. I will try the BufferPolylineCollection when needed, especially when the polyline entity make the system’s performance significantly declines and compare it result.