3D viewer for individual buildings and other objects

Have you mapped a building in 3D and want to see the result? I’ve just launched the OSM2World Object Viewer.

To use it, add the ID of the OSM element to the URL like this:
https://osm2world.org/object?id=r1260102

Features include:

It’s powered by OSM2World. But unlike the existing OSM2World WebGL demo (which is updated weekly), it pulls fresh data on demand. The open source code is available on Github. Thanks to @Beakerboy’s OSMBuilding for some inspiration. :heart:

22 Likes

This is pretty cool. It does work for me in Chrome but not in Firefox!?

Can you say some more about how it handles multiple objects? I tried a few cases of complex buildings where it seems to pull in more than just the object I told it to show (which is good because otherwise parts of the complex building would be missing).

It downloads the element you ask for along with its descendants – way nodes and relation members. Then, in a second step, it downloads all data in the (slightly padded) bounding box around all the previously downloaded elements.

After obtaining all this raw data, it uses OSM2World to convert everything into a hierarchy of 3D models. This hierarchy is what is used to determine what should be part of the output. There are two types of relationships in that hierarchy (parent-child model relationships and attached models), and a connection of either type with the element you ask for will cause a model to be included in the result.

In the case of buildings, for example, building parts are considered children of the building, and a solar panel model may be attached to a building part. The exact semantics for this are coded into OSM2World and depend on object type, but attachments typically result from location, support or (with indoor mapping) level tags.

Once we’ve determined what should be part of the output, only that subset of the scene is fed into WebGL for rendering.

tl;dr: Convert the entire bounding box to 3D, throw away everything you don’t want.

When using the tool, all this means that you most reliably get the result you want by picking the “root” object (e.g. a building outline or building relation rather than a building part).

I’ve actually mostly tested it in Firefox, so it should work. Not sure what’s different with your environment. If you have any extra information to help me investigate this, I’d welcome an issue in the tracker.

1 Like

I’m not sure what is going on, but Way: ‪Église Saint-Bernardin-de-Sienne‬ (‪104599313‬) | OpenStreetMap doesn’t seem to work. The renderer fails

There are building parts covering the whole building.

It doesn’t seem like a browser issue as the result is the same in both browsers

But not mobile phone towers on the roof?

https://www.openstreetmap.org/way/792722803#map=19/-28.153987/153.488384&layers=N

There are two reasons why the towers in your example don’t show up:

  • First, OSM2World currently only renders mobile phone towers, not other types of communication towers. So only towers tagged communication:mobile_phone=yes will be visible.
  • Second, these towers have no tagging to make it explicit that they’re on a roof. You can resolve that by also adding location=roof and min_height=30 (27 for the one on the lower roof).

With these three tags added (assuming they match reality), the towers should appear.

2 Likes

Thanks!

Just updated them so we’ll see how it goes.