mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Add support for rendering different roof shapes

Open lucaswoj opened this issue 9 years ago • 6 comments

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:shape tag (773,099 if you subtract the flat values, which would render identically to having no roof:shape tag).

205,223* of these features also have a roof:height and/or roof:level value. 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 extrusion type, not a type specific to buildings, which I think makes sense. Adding roofs complicates this a bit. Some (possibly questionable) options:

  1. Add extrusion-top-shape and extrusion-top-height properties (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?
  2. Treat the roofs as a separate style layer, with a separate render type of 3d or something. This type would require both 3d-shape and 3d-height properties as above, and also a 3d-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

lucaswoj avatar Jan 17 '17 21:01 lucaswoj

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?

stevage avatar Feb 01 '17 01:02 stevage

I would also add that airport terminals/structures would be another use case.

joptimus avatar Mar 02 '17 14:03 joptimus

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

leehoss avatar May 01 '23 00:05 leehoss

+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.

fr-an-k avatar Apr 28 '24 06:04 fr-an-k

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.

fr-an-k avatar Apr 28 '24 07:04 fr-an-k

3D OSM roofs: https://demo.f4map.com/#lat=56.3292541&lon=44.0113134&zoom=16&la=la

fr-an-k avatar Apr 30 '24 14:04 fr-an-k