Logo OpenStreetMap OpenStreetMap

OSMgo.org roof:type=gabled

Zapsal -karlos- 18. 4. 2025 v jazyce English.

Once I had a concept to render gabled roofs in 3D with OSMgo.org but it did not work. Often the roof looked like broken down. After a long time of abandoning OSMgo, I found a “working” solution and used it in my code. But no, the browser got stuck in an infinite loop %-(

May be update the version of ThreeJS, after years? That took me many many hours. For the geeks: Using es6 needed much export and import. After hours of typing, I fond at last VS-Code plugin to show me the missing variables. Not using “with” any more needed a lot of “this”. Worse, ThreeJS dropped the geometry.merge() and changed the geometry attributes, typing, typing. Hey, something positive!: Because now Vertex-Colours are used, only one Draw-Call per 3D-tile is needed. OSMgo should run faster now.

With the new ThreeJS the infinite loop was gone, but: the roof was at the wrong place and direction. Some adaptions of the theft code were needed. Now, the City of London looked much better than before. Oh wait, all roofs were mirrored, one more adaption.

City of London

And still, not all gabled roofs are ok, but I don’t understand that split-shape function. Do you know a better one? I will look into OSMBuildings, StreetGL and the Web.

Finally, just for the fun of it, I set the fefault roof:shape to gabled, if it is a simple small building.

If you like to try the new version, use http://osmgo.org/v03.html or in the map popup menu use the symbol with the smily (It also starts the multiuser mode) All that editing to update to the actual ThreeJS caused some other errors too. If you see some, please tell me.

Passau Dom

There were quite some oddities about 3D tagging. The German Passau Dome has got two symmetric skillions. One direction is tagged with “S” which is not exact but ok. Only it is not needed. The default is ok anyway: “the longest part of the way is the high line of the slope”. The other side was rotated wrongly in the opposite direction because the code limits the angle to +/- 180 but correct not with 360 but only by 180 degrees. And finally: both slope angles were not equal. Because one roof was tagged with a height, the other height was only set by the renderer default angle, which was different. 3D Tagging (and rendering) is tricky. If the building and roof heights are tagged by Meter, the roof is part of the height. If the heights are estimated by the levels, the roof is added! What about mixed methodes? We can discuss about many details. Actually the solution is: “Make it like F4map.org”, because most existing edits are “tagged for the F4-renderer”. But as it is closed source, we have to find things out by examples.

All in all, the refurbishing gave a lot of know how to me which may be used for future projects.

I would not recommend it, but the source code is on GibLab.

Ikona e-mailu Ikona Bluesky Ikona Facebooku Ikona LinkedIn Ikona Mastodonu Ikona Telegramu Ikona X

Diskuse

Komentář od Minh Nguyen z 27. 04. 2025 v 15:30

Actually the solution is: “Make it like F4map.org”, because most existing edits are “tagged for the F4-renderer”. But as it is closed source, we have to find things out by examples.

All I have to say about that is:

🌴

Komentář od -karlos- z 27. 04. 2025 v 19:53

🤔

Komentář od Minh Nguyen z 28. 04. 2025 v 04:22

Sorry, that was cryptic of me. F4Map apparently uses crown_type=I to mean palm tree. I only found out by accident when looking at the browser console, desperate to get a palm tree to come out.

Komentář od rene78 z 28. 04. 2025 v 12:17

Thanks for your great work, Karlos! Hopefully one day there will be an intuitive way to create 3D-buildings in editors. Then people will actually start to add 3D tags to the map.

Komentář od -karlos- z 28. 04. 2025 v 14:55

@Minh Nguyen Great hint. Culture cap! I just used the default trees of MY region. Palm trees grow about between the upper and lower latitudes of Afrika. So I have to create a Palm geometry and use it als default there. And if it is tagged, even as this is a great mess of variants. Wait for it.

@rene78 Well yes, there should be an editor. I consider to start one. Usable in AR devices to see the real building behind the OSM mesh … - just dreaming. But not for really complex things, like the London Eye. GLB-Files should be used there.

Přihlaste se k zanechání komentáře