Announcing Cesium OSM Buildings

Hi everyone,

We’ve just announced the release of Cesium OSM Buildings, a 3D buildings layer covering the entire world.

Read all about it on our blog!


Cesium OSM Buildings in Denver

Oh, good, you’re back from reading the blog. As one of our CesiumJS power users, you’re probably interested in the technical details. Great!

Similar to Cesium World Terrain, Cesium OSM Buildings is hosted on Cesium ion and is streamed to your end-users’ web browsers on demand. It uses the 3D Tiles format, which arranges tiles into a hierarchical level-of-detail structure so that just the areas that are needed for the current of view - and with appropriate detail - are transferred and loaded. We originally designed 3D Tiles for Cesium, but it has seen fantastic adoption throughout the industry and awhile back it even became an OGC Community Standard. Cesium OSM Buildings arranges the tiles into a loose quadtree. Imagine that each of the dots in the diagram is a building. Buildings are loosely arranged into quadtree tiles, but buildings on tile edges can spill into adjacent tiles without being artificially split in two.

The dataset consists of about 3 million tiles and hundreds of gigabytes, containing in total over 350 million 3D buildings. The buildings themselves are derived from OpenStreetMap’s Planet OSM, and include full OpenStreetMap metadata (“tags” in OSM parlance) for every building and building part. The buildings - and, in fact, the building parts - can be styled on-the-fly using 3D Tiles Styling.

OpenStreetMap does not use triangle meshes or multipatches to describe buildings. Instead, bulidings are represented in the source data as extruded 2D polygons with optional roofs of various shapes on top of them. The flexible schema is described in the OSM wiki’s Simple 3D Buildings page. Our custom pipeline turns these descriptions into triangle meshes in glTF format and batches them together for efficient rendering. Even though the buildings are batched together, however, they are still queryable and styleable as distinct features. This makes it easy for CesiumJS-based applications like Cesium Stories to display the metadata for a building on click.

As we mentioned in the blog post, being based on OpenStreetMap means that anyone can improve the dataset! We think this is very cool. Initially, we’re committing to updating Cesium OSM Buildings on a monthly basis, but we intend to increase the cadence over time. Continuous updates are not out of reach. Anytime we talk about editing OpenStreetMap, however, we want to support the OSM community by reminding everyone: don’t tag for the renderer. Please do fix inaccuracies in the OSM data. You’ll be a legend. But if you happen to find a case where the OSM data is correct yet you’re not happy with how Cesium OSM Buildings renders it, please let us know instead of working around it by editing the data.

We’re not the first to render OpenStreetMap buildings in 3D. But we believe OpenStreetMap 3D buildings and CesiumJS make a tasty pairing, bringing the rich natural environment of Cesium World Terrain together with a useful model of the built environment. On top of that, you can then bring your own data, leveraging the static and dynamic visualization that CesiumJS is famous for. We’re proud of the attractive outlined rendering, enabled by the new CESIUM_primitive_outline glTF extension, which is now implemented in CesiumJS and is available for use in other glTF and 3D Tiles datasets. And we’re proud of the rendering performance, particularly given CesiumJS’s completely unconstrained camera views. For most styles, we’re able to render entire cities using just a single draw call per tile, minimizing the overhead of rendering in a web browser.

Please try it out and let us know what you think! For the best experience, please make sure you’re using CesiumJS v1.70.

6 Likes

Looking good. Thanks Cesium. I expect the unique building rendering will find its way into https://terria.io/ when v1.70 is migrated? Though I note Australia is typically behind the US here.

Shown is the view of the Sydney CBD, Australia. Together with the soil type.

Hi Russell,

Yes, TerriaJS will get the outline rendering automatically when it upgrades to CesiumJS v1.70. You can get the building coloring today just by adding a style to your catalog item:

style: {
  color: "Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : color('#ffffff')"
}

Kevin

1 Like

Hi,
OSM Buildings looking good. I would like to use a similar style in my solution. I use my own generated buildings served with ion. Is it possible to add primitive outlines to these gltf models. In this collection, it uses KHR_draco_mesh_compression extension. Is it possible to use CESIUM_primitive_outline with KHR_draco_mesh_compression?

What type of data are you uploading to Cesium ion? If you’re uploading glTF models I think you should be able to add the extension Kevin mentioned (https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline) to your source data and retain that through the tiling process.

This is a great addition to Cesium. Thanks the Cesiumjs development team for your tireless contribution!

1 Like

Thanks for the answer. It is possible to enable or disable outline dynamically, e.g. using the settings of the cesium itself? I don’t want to use silhouette for this. I need this solution to control the map and content style.

Thanks for the kind words Henry! I’m curious to hear if there’s a specific project or application you’re planning on using Cesium OSM Buildings for.

This isn’t currently exposed in CesiumJS, I opened a GitHub issue here with some details on how this can be done by modifying the source code: Expose ability to turn off outlines for 3D models? · Issue #8959 · CesiumGS/cesium · GitHub

thanks a lot for osm buildings.
Next step : do you plan to add osm bridges ? (prevents me from doing my own experiments)

Hi,

Next step : do you plan to add osm bridges ? (prevents me from doing my own experiments)

Can you perhaps point us to OSM documentation on tagging bridges (especially for 3D), or to examples of well-tagged bridges?

Thanks,
Kevin

hi ;
i have posted some trial of drawing main bridges in a range of 100kms with a bridgeurl to get bridges ways with their nodes at the same time

you can find it there => http://chungswebsite.blogspot.com/2020/06/mycesiumflight-osm-openstreetmap.html

2 Likes

Hi. can i use Navmesh in here?

Hi,

Great work on adding OSM Buildings. I notice the actual OSM data itself is getting quite dated. Do you have any intention to update it (an initial “one-off” would help, but ideally on a regular basis)?

Thanks,

We were updating it monthly for awhile, but I’ve been caught up in other priorities lately and haven’t updated it in ages. Thanks for the bump, we’ll aim to get back to a regular cadence soon.

2 Likes

Hi Kevin,

That’s great to hear - thanks for the update.

Steve

I’m not sure if this is the correct thread to put this in, but I found a completely broken building in OSM Buildings. It is located in the town Beckenried in Switzerland. Just thought someone would want to know.

Thanks @martin_d. The OSM data here is a little odd. There’s a relation of type “route” that is also tagged with “building: commercial”, so Cesium OSM Buildings is trying to treat that as a building.
https://www.openstreetmap.org/relation/13955819

There are some actual buildings in that relation, such as this one:
https://www.openstreetmap.org/way/121883765

But that giant triangular thing is this way:
https://www.openstreetmap.org/way/23093079

Which has a role of “route” and no tags that mark it as a building.

So I think tagging the entire route relation as a building is probably incorrect tagging and could potentially be edited in the OSM data, which would fix this problem. But also our Cesium OSM Buildings tiler should probably explicitly exclude ways inside a relation that have a role of “route”. And that would also fix the problem without editing the OSM data.

I’ve written an issue for this internally and will try to get the tiler change into the next release. But if you agree the building tag on the relation is wrong, and are comfortable making edits to OSM, that would be appreciated as well.

Kevin