Gltf embed metadata, EXT_mesh_features, EXT_structural_metadata

There are many degrees of freedom for structuring data sets in general. And the point of metadata adds a whole new dimension to these existing degrees of freedom. The question about what is “The Right Structure” is an engineering question. It is impossible to give profound recommendations here, without a diligent and detailed analysis of the requirements and goals.

For each possible solution, there are pros and cons, or possible caveats and constraints. As mentioned in an earlier thread, where you asked about this, one constraint is that there currently appears to be a bug in CesiumJS where styling based on metadata is not applied.

Therefore, the following should be considered as a “workaround”. It is not ‘the recommended solution’. It only shows one way of how it might be possible to achieve what you want, involving many, many guesses and assumptions.


I took the glTF file that you provided, and created two additional copies of that (moved about 10 and 20 in x-direction, just to have them at different positions). I created a tileset.json that refers to these glTF files. (And this uses a proper bounding box - the one that you provided did not match the data).

In that tileset, I defined a metadata schema - roughly corresponding to the metadata that you provided. (I only omitted the ‘tile’ information. You’ll have to think about how to encode that sensibly. The structure of "Tile": { "x": 119168, "y": 48377, "level": 16 } does not directly match one of the metadata types, but you could store it as a VEC3/INT32 or so - similar to how I stored the coordinates as a VEC3/FLOAT32 for this example)

The tileset refers to each of the GLB files. Each GLB file is one ‘tile’ in the tileset. Each of these tiles has metadata that matches the schema.

The only difference in these tile metadata entities is the Voltage property: It’s 123, 1234, and 12345 for the different tiles.

The result is in this archive:

Forum-29582-example.zip (5.3 KB)

The archive contains a Sandcastle.js that shows how this metadata might be used. The sandcastle inspects the tiles that are loaded, looks at the metadata of these tiles, and applies different styles to the content of these tiles, depending on the Voltage value:

  • For Voltage < 1000, the content is green
  • For Voltage > 1000, the content is yellow
  • For Voltage > 10000, the content is red

Again: This is a workaround for the styling bug linked above. When you say that you have 10000 tiles/powerlines, then this may cause some performance issues. It might be possible to find a better solution here, but it is intended as one example/demo.

The following is a short screencapture of that sandcastle: The power lines are rendered with different colors. The tooltip shows why - namely, because they have different Voltage values.

Cesium Forum 29582

Once more: This is not “THE” recommended solution. Whether or not this suits your needs is hard to tell. But it shows one possible approach for assigning metadata to tiles, and using that metadata for styling and inspection.