Feature Request: Integrate OSMBuilding into iD to preview buildings
It would be very helpful especially for less experienced users if OSMBuilding could be used to preview building shapes and colors while editing them in the iD editor. Such an integration may be possible using Tampermonkey.
You’ve pretty much hit on exactly what I was hoping would happen with this project if it caught on. I imagined it could be used within an online editor or even at the openstreetmap object viewer:
https://www.openstreetmap.org/way/294867466
If the way is a building, it could be rendered right there.
This would be a great idea, and since somebody in the OSM community is already building a tampermonkey script for enhancing the OSM.org website, it might be a good idea to talk to this person?
(I don't really know much about tampermonkey and/or this script, but I know it's there and being developed, so I thought I'd mention it!)
@deevroman is this something you think could work?
Looks cool! Maybe I could add this to Rapid. We have had a MapLibre-based 3d viewer for a while now.
https://github.com/facebook/Rapid/discussions/993
I think at this point it doesn’t make sense to add new features to iD, but I am glad to see that it still exists and people like it. I was forcibly removed from the maintainer position in 2020. In the years since then, we have mostly rewritten the code and now Rapid is faster and more stable. Most users really would be better off upgrading from iD to Rapid.
I looked quickly through the code and I think what we'd really need is just the parts that convert the OSM feature into the mesh. We wouldn't need the parts that download the data, or parse the xml, or render to three.js.
As already said, the alternative could be the 3D view in Rapid. I'm still afraid to add new functions to iD using userscript. It's safer and easier to fork iD and replace it with a fork.
Speaking of osm.org, I might consider adding a link/hotkey that opens that building viewer.
The 3D view in Rapid is indeed really close to what I was suggesting, however, it does have some drawbacks compared to OSMBuilding. For example, it doesn't appear to work with the building (relation https://www.openstreetmap.org/relation/4594998) I was testing it with but that ones is ok in OSMBuilding: https://beakerboy.github.io/OSMBuilding/index.html?type=relation&id=4594998
And if I'm not mistaken, it's not working with gabled roofs (but there may be issues in OSMBuilding as well. e.g. https://beakerboy.github.io/OSMBuilding/index.html?id=285102551)
The 3D view in Rapid is indeed really close to what I was suggesting, however, it does have some drawbacks compared to OSMBuilding. For example, it doesn't appear to work with the building (relation https://www.openstreetmap.org/relation/4594998) I was testing it with but that ones is ok in OSMBuilding: https://beakerboy.github.io/OSMBuilding/index.html?type=relation&id=4594998
Oh yeah , Rapid's viewer is still very limited - it can only show simple extruded buildings.
It doesn't support multipolygons or roof shapes, or proper meshes like OSMBuilding can generate, but it would be great to improve this.
We have some of these limitations tracked here: https://github.com/facebook/Rapid/issues/1109 https://github.com/facebook/Rapid/issues/1061
@canavan OSMBuilding must be broken somewhere. Gabled roofs used to work great but I see they are no longer rendering.
Is there anything that needs to be done to my codebase to allow someone else to integrate it into their app? If not, I can close this and we can move the conversation into the discussion area.
If iD allows you to export the map state to .osm, then it doesn't look so crazy anymore (:
https://github.com/user-attachments/assets/6c330cf1-3453-442a-8c5c-91ccf4f14ef0
Is there anything that needs to be done to my codebase to allow someone else to integrate it into their app?
Merge PRs :)
Believe this is complete on my side, correct?