All new 3D rendering ... an "OSM Building Inspector"

A) Would you like to have a detailed description how to convert the OSM 3D tagging into a VR scene?

B) Would you like to have an all new software to 3D render OSM?
B1) Would you like it in a new programming language with some great concepts but still annoying memory management: Zig?
B2) Or would you like a stable and save language, building native, mobile and Web and not that hard to learn: Rust.

C1) Would you like just an OSM Building inspector, showing the actual view directly from the OSM database? (May be with editing them.)
C2) Or an Earth wide 3D tile renderer
C21) just as a 2.5 rendering to place on 2D tiles
C22) or a 3D on tile maps like F4Map or Streets.gl
C23) or like the only really full scale 3D renderer OSM2World?

D1) Would you like to have an more detailed overview of all existing Rust crates, related to OSM?
D2) And would you like to have all this crates harmonised by defined APIs to use them like Lego brigs to build OSM 3D tools?

I would like to have all of this. I would even like to make all of this.
Would you like to participate? In which one of them above?

I am not in prison, no time to code or write all of this. But I started with C1+B2:
“OBI” in short. You may try it like this:

https://www.OSMgo.org/bevy.html?way=osm-id
Takes 20s for the first load. Just arrow keys work.
Try some buildings, you like.

It is still quite beta! To get into the topic I did NOT use any OSM crate firstly.
Find more details in the OBI repository

4 Likes

And now :trumpet: with roof:shape=dome :mosque:

6 Likes

And now with relations as building/:parts multipolygon for parts with holes

May need reload and take 30 seconds:
St.Pauls

A small legend would be nice where you describe what button does what. I figured now arrow keys and additionally A and Y to tile the object itself left or right and S and X tilts it backwards and forwards, for example. R for resetting the object (not the viewport).
I was trying to find a “camera up and down” ^^

You found it all. It‘s only a quick hack. „Soon“ it will be like F4map with extentions. Mainly Orbit Control. But you may tell your wiches.

And it‘s only a demo control. The OSM Toolbox is open for user controls, other engines but Bevy, other input souces; even other 2D/3D renderer.

1 Like

Test it: https://osmgo.org/bevy.html?way=166431070&range=444

London City


The #bevy #demo got a better control: keys, mouse, touch. Read the details in the repository readme:
github.com/DerKarlos/obi/blob/

Test the new version of the OSM Building Inspector (example web app) at this new URL:
osmgo.org/obi/

1 Like

Some words about
Subtracting building.part’s

Inside?

Buildings may get replaced by parts. If there is no relation, only the position/footprint tells, if the part get’s visible. First, I did not care and just rendered all parts. That got slow, if a large area with many parts is rendered. As I already had a bounding box for each way, I added this lines speeded the code:

    if self.east < other.west
    || self.west > other.east
    || self.north < other.south
    || self.south > other.north

Even the first line drops up to 50% of the parts. But thats only a raw roll. Inspecting a building should not show other parts outside. I spied in the code of BakerBoy’s “OSMBuilding” and fount a function “inside”. We disagree, but I think, only if ALL nodes are inside, the part is inside. But it did not work, nodes/parts are calculated outside, even if in the ID editor, it is clearly not so. I did ask for the code of OSM2World but not Streets-GL or the new Josm viewer. (Please maintainer, show me the used function).
I asked an AI to write me an “inside” code: not working. I checked for Rust libraries for “inside” and found crate geo. It is strange: If I use the LineString (like a way) I can only check if a point is ON that line. If I use the crates MultiPolygon, it works, mostly. The geo-calculations cause small differences. Or the user may have set a Node slightly outside. The solution came from OSM2World: If 99% of the part area is inside the building, it counts.

Building in Building?

After the “inside” worked, I checked an area around St.Pauls in London and observed flickering walls.

INSERT VIDEO

The debugger showed, there are parts of the outer building and an inner building at the same place. A mapper seems to have sorted the parts and overseen the inner building. Is there any allowed or meaningful construct to have a building inside a building, except this two:

  • A building may get bigger above a neighbouring building.
  • Inside of “holes” of a building may be another building.
    But there never should be a building fully inside of another building, ok? We could have a check tool, may be a challenge for Keep-Right?

Not all of it?

The OSM wiki says “The entire building outline should be filled with building:part=* areas,…”. Well “should” is not “must”. And there are quite some buildings with remaining of the “outer”. OSM2World drops the outer if only 40% are left. That would not work here. Could we have criteria like: the building tags include roof:*?
Or shall we add the missing part(s), a tool/Keep-Right?