Add extra data to 3dtileset during creation

Hello,

I would like to add some extra data such as {dataId: 12345, type: “secondary“} or something similar to a 3dtileset when its being created with Cesium3DTileset.fromUrl('url', { options });

I know I can add it through the tileset json and access it through extras but is there another way? I could also just add a property to the returned tileset object but I would like to see if there was a better way.

The use case is that when I click and pick a 3dtileset, i would like to do different things based on which tileset it is.

Hi @jin ,
Thanks for your question and apologies for the slow reply.

This thread has a thorough discussion of some options for adding metadata to tilesets. Best practices for tileset and glTF structure and embedding metadata - #3 by 11e4c08f99c6aef7429e If the options discussed there do not meet your use case, please let us know how and share with us a bit more what you are looking for and what your contraints are.

Thanks,
Luke

Hello, thank you for the link but I dont think that is 100% related to my question.

I know that I am able to add extra data through the 3dtiles json which will be shown in the readonly extras within the tileset after it was ingested by cesium through Cesium3dTileset.fromUrl or something similar.

What I am looking for is if theres a way to add extra data while creating the Cesium3dTileset object through Cesium3DTileset - Cesium Documentation (Cesium3dTileset.fromUrl)

What I would like to do is something like const tileset = await Cesium3dTileset.fromUrl(‘urlToTilesetJson’, {extraData: {id: ourInternalIdForThisTileset, priority: 3}}
const internalId = tileset.extraData.id

and then we would be able to figure out our own internal id for this tileset. I could create a custom type for this but I was wondering if something like this already exists.

Hi @jin ,

Thanks for your follow up. The short answer is that CesiumJS does not have API support for the capability you are inquiring about at this time. This is an area targeted for improvement, so I noted your use case on the main issue tracking ideas for this effort here Tools and processes for assigning and editing IDs and metadata · Issue #801 · CesiumGS/3d-tiles · GitHub

There are workarounds in Cesium for Unreal which are unfortunately generally not low-effort Adding metadata to the OSM dataset - #2 by Kevin_Ring. If you are interested I can research if similar workflows are available in CesiumJS with the heavy lifitng documented (with a cursory look now I do not see any documented).

Thanks and please let us know if you have more questions or thoughts to share on this topic.

Best,
Luke