Skip to main content

Bring Your Cesium ion 3D Tiles and Bing Imagery in osgEarth

This is a guest post by our friend Jason Beverage of Pelican Mapping. Pelican Mapping maintains the open source osgEarth, the leading geospatial SDK built on top of OpenSceneGraph. osgEarth was one of the first engines to connect to Cesium ion, and they’ve now expanded that integration so you can easily visualize your Cesium ion assets in osgEarth. Quickly tile your 3D data with Cesium’s cloud-based tiling pipeline, and seamlessly add it to your osgEarth visualization.

Pelican Mapping is proud to announce support for loading 3D Tiles and Bing image layers from Cesium ion to their osgEarth globe rendering toolkit.

Adding Support for 3D Tiles

osgEarth displaying photogrammetry of Melbourne, Australia, from Cesium ion.

We’ve been developing support for 3D Tiles in osgEarth over the past year and it’s proven to be an exciting and efficient format to work with. We started by developing a glTF reader and writer for OpenSceneGraph based on TinyGLTF. From there, we built a 3D Tiles layer plugin for osgEarth that handles streaming tiles in. osgEarth decides when to load and display tiles based on the same screen space error metric that Cesium uses, so 3D Tiles layers should look nearly identical in osgEarth as they do in Cesium at the same viewpoint. Once the 3D Tiles loader was developed, we were able to quickly add support for Cesium ion by adding ion’s token based authentication to the 3D Tiles layer.

Bing Maps

osgEarth rendering Bing imagery with labels from Cesium ion

We’ve also added support for Bing Maps served from Cesium ion to osgEarth. osgEarth already has a Bing image driver, so we were able to use Cesium ion’s API to get the Bing key and map style and then create an osgEarth Bing image layer under the hood with the credentials provided by Cesium ion. We hope to add support for more external image types in the future.

Putting it all together

Here is an example Earth file of how to load content from Cesium ion in osgEarth.

<map name="Cesium ion"> 

    <CesiumIonImage name="Bing Maps Aerial With Labels">
        <asset_id>3</asset_id>
    </CesiumIonImage>

    <CesiumIon3DTiles name="Melbourne">
        <asset_id>69380</asset_id>
    </CesiumIon3DTiles>

</map>

You can then set your Cesium ion token as an environment variable and then load this earth file with any osgEarth based application.

export OSGEARTH_CESIUMION_KEY=YOUR_API_KEY
osgearth_viewer cesiumion.earth

This video shows osgEarth loading nearly all of the publicly available Cesium ion 3D Tiles layer at once. Check it out!