-
Notifications
You must be signed in to change notification settings - Fork 149
Add support for 3D buildings in MapboxGL #454
Comments
Cool. In the v3 we use the following approach of Paul Norman (OSM Clear to calculate -- 3.66 is obtained by correlating the heights and level data in OSM
-- raising to a power < 1 reduces the height range displayed which looks better
least(greatest(3, COALESCE(height,levels*3.66,5)),400)^.7 AS render_height |
Hi, |
@kekscom With regards to 3D and MapboxGL, I'm not sure it's 100% at the point where it replaces something like Cesium in capability. I have a working offline demo that uses OSM2World and 3DCityDB to fill a database with buildings and dump them to tiles to view in Cesium. It's a powerful solution for handling lots of buildings with the full capabilities of drawing complex rooftops as opposed to basic extrusions. Only hurdle is hardware needs to view lots of buildings in a downtown area when in KML formats. |
Okay, I did the first demos last night. I got it to draw in 3D, but I don't have any proper height dependent 3D drawing yet. Might be an issue that I did Switzerland, mostly centered over Zurich so not much in the way of complex buildings. I will try New York next. Unfortunately the fill-extrude-height and fill-extrude-base requires "stops", adding a layer of complexity to my demo style. Second issue that I may face, what "order" do I do in the tm2source for buildings? Right now, it's |
@stirringhalo First I needed to know whether you would be interested in adding more information. As coverage with extended buildings tags varies a lot, it might not make sense to predefine e fixed attribute set. Once there is an agreement about that, I'm fine to work on the renderer. |
@kekscom I have no problem adding more tag information. |
Have to figure out why building:part is missing, I'm not as familiar with imposm3 mapping as I am imposm2. Any thoughts @lukasmartinelli ? I'd like to put forward a tm2source eventually with all the tags, but it will explicitly not be compatible with Streets as much as reasonably possible. |
I figured out the bug, it was a missing set of keys in mapping.yml! Looking great so far, I'm adding the additional features and I'm testing data-driven colouring using the colour functionality. I would love for Mapbox to add support for fallback values in the "identity" function when a value does not exist. For now, I'm just fill with default values in DB but it's definitely ugly. |
Just note here which OSM source data you require for the 3D buildings.
Wow looks very nice ❤️ |
@lukasmartinelli I'm waiting on mapbox/mapbox-gl-style-spec#480 to see how default fall-back styles will be handled for the identity function. Feel free to rip these out and put them into the open tm2source and associated import workflow. |
Integrated with OpenMapTiles.... https://openmaptiles.github.io/klokantech-3d-gl-style/#14.47/40.7086/-74.0049/16/56 |
Amazing! Any idea what's happening with the Eiffel Tower though? https://openmaptiles.github.io/klokantech-3d-gl-style/#15.85/48.8593/2.2959/0/57 |
@nicooprat The 3D is formed by straight extrusion in the z-direction with no complex roof shapes or diagonals in the z-direction possible. So all building/building:parts are rectangular! Without any further awesomeness in Mapbox-gl-js, this is as far as we can go. |
Oh too bad! Thanks for the explanation. And your work, of course :) |
@klokan Hmmm, I wonder if it's an issue with units/stories/feet in the base feature of OSM that caused that as I've seen nothing elsewhere (especially over NY) to suggest there's a widespread issue. I have seen some super impossibly tall towers in Mumbai, suggesting it's an issue with how imposm3 imports/converts it. I will dig into this! openmaptiles/openmaptiles#128 |
In light of added support for fill-extrude-height and fill-extrude-base, I'd like to add the height attributes to OSM2Vectortiles backend so at a later date, a tm2source and style (probably Liberty) can pick it up.
I'll take this on. Steps I can see:
More todos:
The text was updated successfully, but these errors were encountered: