Reduce memory usage for rendering polygon entities

I have 2 topojson files each about 3.5MB and with several thousand polygons and associated properties. Specifically, one file has zip code boundary polygons of the Western US, and another with building polygons of an area in Los Angeles. I’m loading these into viewer.dataSources each as their own EntityCollection.

The app works fine with rendering either one, but runs out of memory when attempting to load and render both. Is there any good workaround that would reduce the memory usage of loading/rendering these polygons? I’m fairly new to CesiumJS (and honestly web dev in general), and have yet to see any sandbox demos tackling something of this scale that could offer a hint at a solution.

Hi David,

There is a detailed explanation in this thread that goes into the details of why Cesium may hang when loading large amounts of data without any tiling. Ultimately if you’re loading too much data for your machine to handle at once, the solution would be to convert your data to 3D Tiles, a format optimized for streaming in the browser.



Hi Gabby, thanks for the reply. Since your response, I've been doing quite a bit digging into 3D Tiles.

From a technical perspective, how would you suggest I should approach converting the 2D polygons in these files into a 3D tile format that can be rendered by Cesium? Unfortunately the data I use cannot be handed off to be processed by a 3rd party at this time.

- seems to indicate that the datasets can be converted into vectr format, but indicate that this may not be fully supported yet?

- I took a look at the features of the 3D tiles tool ( Are there any appropriate conversion tools in this suite that can be coupled with another conversion tool to convert geo/topojson polygons -> ____ -> 3D-tile?

I understand you may have restrictions on your data. If you contact Tim, perhaps we can figure out the proper channels where you could get the data processed if possible.

PR #288 merged the official 1.0 version of the spec which we submitted for validation as a community standard to the OGC. While vector tiles are not a part of that, checkout the**3d-tiles-next** branch for vector tiles and other formats that are under development, but will still run in Cesium.

I’m not aware of any other public tools that will convert geoJSON/topoJSON to 3D tiles, but Tim may be able to point you in the proper direction.