Polygon Entity extruded height performance

I am trying to show aggregate metrics using H3 polygons and a combination of color and extruded height over time. I am experiencing a large performance drop using a SampledProperty with the extrudedHeight of the polygon.

Here is an example with the extruded height:

I originally was generating CZML to do this and then tried just creating the entities myself, though it didn’t make a difference.

I have another example without it and just the interpolated color and the performance is fine. I am wondering what I can do to improve the performance. Would using the geometry and appearance APIs and creating/removing the primitives myself be more performant? It seems like it spends a lot of time in the main thread updating the PrimitiveCollection, so I am not sure if that would even make a difference.

Is what I am trying to do even reasonably feasible for CesiumJS?

1 Like

Hi there,

So when changing to extruded height of a polygon, there is some recompilation that needs to be done under the hood to create vertex data and send it to the GPU.

Using the underlying primitive API will give you more control, but will have more code overhead.

Also, the performance I’m seeing here is definitely not what’d I’d expect.

Do you mind explaining the data you’re loading via CZML?

Here is an example of the CZML per polygon I was generating:

  "id": "832688fffffffff",
  "name": "832688fffffffff",
  "description": "Metric in H3 Cell: 832688fffffffff",
  "polygon": {
    "positions": {
      "cartographicDegrees": [-104.33169514214511,37.61299079256905,-103.85102976556078,38.135049165836236,-104.20599904013339,38.72118935402389,-105.04826666914855,38.784053392458446,-105.52685292295116,38.25975663382743,-105.16538034685188,37.674847673581894,-104.33169514214511,37.61299079256905]
    "material": {
      "solidColor": {
        "color": {
          "epoch": "2023-09-01T00:00:00Z",
          "rgba": [0,0.8173,0.3451,0.047,1,1800,0.298,0,0.2078,0,3600,0.9566,0.6292,0,1,...]
    "extrudedHeight": {
      "epoch": "2023-09-01T00:00:00Z",
      "number": [0,100000,1800,0,3600,600000,5400,800000,...]

The extrudedHeight and color would just be extended out further, every 30 minutes for the rest a 24 hour period.

Each H3 polygon shows an aggregate metric on a 30 minute interval. I’d like to be able to interpolate between the values to show it smoothly animate over time.

I’m running this on an M1 MacBook Pro, if that makes any difference.

Any help is appreciated. Thank you!