Testing for 3DTileset properties

Hi there,

Is there a way to test for 3DTileset properties? We have a bunch of pointclouds, and some of them have Height properties and some do not. I’ve been tearing my hair out trying to find a way to test if a tileset has these (or other) properties, but can’t seem to find them, or find a way to silently just ignore the conditions instead of exploding all of Cesium.

Any clues?

Cheers,

Alex

Hey Alex,

There’s some details in this issue: https://github.com/CesiumGS/cesium/issues/8413. The short answer is it’s not currently possible. Are you generating your own 3D Tiles? The easiest thing might be to record these properties in the tileset.json’s extras object that you can query at run-time.

Hi,

Thanks for the quick answer. And that’s a bugger; Cesium can blow up at random! :slight_smile:

Yes, we do our own tiling. Currently we do create extra files we check, but it would be so much easier if I could do a quick check on some property deep in the bowels of the 3DTileset object instead of checking an external file / .json object. Do you think this will change in the future?

Cheers,

Alex

If you add it in the tileset.json’s extras object, you can query that at runtime without having to fetch any additional files: Cesium3DTileset - Cesium Documentation.

Yeah, it is actually possible in principle to do this currently, but nothing exposed directly in the public API. I posted some thoughts on what I think a solution could be here: property check fails in style expression · Issue #8413 · CesiumGS/cesium · GitHub.

Hi,

Thanks for that. Hmm, I’ll see if our backend guys can inject the JSON metadata into the object instead of an external file, makes sense.

As to putting the tests against non-existing properties in the style script, yes, that’s not an evil plan per se. :slight_smile: Have you tested the performance on that? I’ll give it a spin to avoid crashes at least, I just can’t report back to the UI about it (which is the best way).

Thanks for your help, mate, appreciate it.

Cheers,

Alex