Bug when buildings inside each other

Hi,

I noticed a problem. I tried out the new openstreetmap integration. and I noticed that if someone mapped a 3d building, but not fully. (in this case only the tower, not the actual building itself). Then on Cesium it will ignore that building. While I get where this thinking came from, it does result in this instance it not showing correctly that well.

Osmbuildings does it better I think:

Hi, thanks for reporting this!

This is a problem with the way the building is modeled in OpenStreetMap. The building has two parts.
One is the main body of the building: Way:158897049
The other is the tower: Way:388862470

The OpenStreetMap Simple 3D Buildings “spec” says that anytime a building contains one or more parts, the main building should be considered an outline and the parts should be rendered in 3D instead of the outline. So that is what’s happening here. The tower is a part, while the main body of the building is not. So only the tower gets rendered.

The simple solution is to add a tag "building:part": "yes" to the building’s main body.

There’s more detailed discussion of this issue here: https://github.com/CesiumGS/cesium-ion-rest-api-examples/issues/329

This is a common issue, though, and it’s reasonable to ask why OSM Buildings shows this building “correctly” and Cesium OSM Buildings doesn’t. Here’s my explanation from the issue above:

Now the next question is, why do OSM Buildings and F4Map display it? Well, I’m not completely sure. They seem to be using a different heuristic for deciding when to include the outline in a building that also has parts. We can almost certainly tweak our logic. This is a tricky thing, though. The danger is that we end up showing the outline when we shouldn’t, and it obscures or depth fights with the parts. And when that happens, it’s harder to fix. As compared to the present situation where, when we find an outline missing, the solution described above is a straightforward change to the OSM data to bring it more in line with documented OSM best practices, and it is unlikely to break any existing clients.

Kevin