Add support for rendering different roof shapes
migrated From https://github.com/mapbox/DEPRECATED-mapbox-gl/issues/17 by @nickidlugash
What would it take to implement roof rendering for buildings, so we can improve the accuracy of renderings of complex and high-profile landmarks?
Some questions I've been thinking about:
Which OSM keys would we support?
OSM currently has 1,028,142 features with a
roof:shapetag (773,099 if you subtract theflatvalues, which would render identically to having noroof:shapetag).205,223* of these features also have a
roof:heightand/orroof:levelvalue. These values would be helpful not just to render accurate height, but to give certain distinctive-looking roofs the proper proportions (e.g. very elongated pyramid-shaped roofs on cathedrals).The rest of the roof tags are probably not useful (either not relevant, or are not used widely enough).
How would we represent roof properties in the spec?
The current spec additions that @lbud has added to her working branch are all for a generic
extrusiontype, not a type specific to buildings, which I think makes sense. Adding roofs complicates this a bit. Some (possibly questionable) options:
- Add
extrusion-top-shapeandextrusion-top-heightproperties (or however they would be named). This would involve creating support for a bunch of simple 3D shapes. By far the most common are various triangular prisms and pyramids, but also includes spherical domes and onion domes. Are there use cases for additional geometries on top of an extrusion, besides for buildings?- Treat the roofs as a separate style layer, with a separate render type of
3dor something. This type would require both3d-shapeand3d-heightproperties as above, and also a3d-min-height. As above, it would require support for rendering a variety of simple 3D shapes. I haven't really thought this option through.Anyone who has any ideas of how this could work, and how big of a lift it would be, please chime in!
* 107,464 (# of roof:height) + 116,983 (# of roof:level) - 19,224 (# with both) = 205,223
cc @lbud @ajashton @mapbox/gl @1ec5 @ajashton @mourner
Are there use cases for additional geometries on top of an extrusion, besides for buildings?
Freeway on/off ramps. Maybe some kind of primitive terrain mesh?
I would also add that airport terminals/structures would be another use case.
Is there any update to include basic roof-shapes inside mapbox
Simple 'pitched roofs' and ramps would be a staring point
Can the logic from openstreet map be incorporated ? https://wiki.openstreetmap.org/wiki/Simple_3D_Buildings#Roof
+1
FYI: in the Netherlands we have a public aerial stereo LiDAR (AHN) (https://ahn.arcgisonline.nl/ahnviewer/) from which such roof coëfficients and terrain heightmap are derived (https://3dbag.nl/en/viewer). 3D buildings is a very hot topic in this country's institutions and has high potential in the data-driven EU.
One way to implement it is to use an array of height (or beziér coëfficients) per point for a polygon, or more generally supporting TopoJSON per point and per feature attributes (for styling). Another way would be to specify fill-extrusion slant direction and angle, which the user could derive from higher-level source data; that would however require much more redundant point data.
3D OSM roofs: https://demo.f4map.com/#lat=56.3292541&lon=44.0113134&zoom=16&la=la