Get bounding box for asset through Cesium ion REST API

I am trying to search imagery, 3D tiles and other data I have uploaded to Cesium ION with something better then just text. Presently we did not find an API to query geospatially. When a file is initially uploaded there is a white box generated around the file. Can this be exposed for us to leverage? We can add this to our existing geospatial query and have the Cesium tiles and imagery return.

Hey @rakhishah,

Following up on your question here: Filter ION assets based on lat/long provided by user. - ion doesn’t currently support filtering by a given lat/lon. For 3D Tiles, what you can do is load the tileset.json of the asset, and that JSON files defines the bounding box inside (or you can load it into CesiumJS, which will let you get tileset.boundingSphere).

For 3D terrain, the bounding rectangle isn’t actually stored in the 3D data itself. To produce the rectangle you see in the preview window, Cesium ion will compute and save the boundary before tiling the GeoTIFF you upload.

Let me know if this helps.

So, how do I get that box? Its around the imagery and the 3D tiles.

For a 3D Tileset, you can get the bounding sphere with CesiumJS like this:

tileset.readyPromise.then(function(){
  console.log(tileset.boundingSphere);
});

Sandcastle.

For imagery, given an imagery layer you added, you can get its rectangle property: https://cesium.com/docs/cesiumjs-ref-doc/ImageryLayer.html#rectangle

Hi,

Just a follow-up on this; do you guys have any plans to add the bounding box (or central coord) to the Ion API for an asset?

Cheers,

Alex

Hi Alex,

We don’t have any plans for this in the foreseeable future, but if you don’t mind sharing more context, we may be able to provide another way of accomplishing what you’re looking for. Can you tell us about what you’re trying to achieve?

Thanks,
Matt

Hi Matt,

We’ve got Ion asset integration in our platform at an import level, and with all things you can import we show the bounds of assets (WMS, images, other) in a preview globe. However, Ion assets don’t have bounding metadata, so I have to kill the preview for these assets. I’d love to have it there, though, as I want people to go get an Ion account; more for you, more for me. :slight_smile:

Some assets are shared, and I could build bounds for those over time, but honestly, who knows what assets anyone is going to pull in, plus the initial time it’s pulled there’s no preview (not to mention the various techniques to find the bounds). I can only assume those bounds exists in your db, so it would be great to expose them for others to use.

Cheers,

Alex

Hi Alex,

Thanks for those details—very helpful for understanding your use case. We’ve opened an internal ticket for this feature, and I will comment here with any updates on it. We don’t have a timeline for it yet, but it is a reasonable request that I hope we’ll be able to meet.

Thanks,
Matt

1 Like

Thanks Matt,

That is much appreciated!

Cheers,

Alex