# Testing for 3DTileset properties

**URL:** <https://community.cesium.com/t/testing-for-3dtileset-properties/10930>\
**Category:** CesiumJS\
**Created:** [September 15, 2020, 7:06am UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930 "2020-09-15T07:06:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [September 15, 2020, 7:06am UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930/1 "2020-09-15T07:06:02Z")

</div>

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

 ![image](https://global.discourse-cdn.com/cesium/original/3X/8/8/886b5c156c4c7863fa7c2d2558d79ed059ba066d.png)

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [September 15, 2020, 5:30pm UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930/2 "2020-09-15T17:30:42Z")

</div>

Hey Alex,

There’s some details in this issue: [https://github.com/CesiumGS/cesium/issues/8413](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.

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [September 15, 2020, 11:49pm UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930/3 "2020-09-15T23:49:56Z")

</div>

Hi,

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

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

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [September 15, 2020, 11:52pm UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930/4 "2020-09-15T23:52:16Z")

</div>

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](https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html#extras).

> [@Alexander\_Johannesen](#):
>
> Do you think this will change in the future?

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](https://github.com/CesiumGS/cesium/issues/8413#issuecomment-692858758).

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [September 16, 2020, 12:56am UTC](https://community.cesium.com/t/testing-for-3dtileset-properties/10930/5 "2020-09-16T00:56:07Z")

</div>

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. 🙂 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
