Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rendering different roof shapes #3998

Open
lucaswoj opened this issue Jan 17, 2017 · 6 comments
Open

Add support for rendering different roof shapes #3998

lucaswoj opened this issue Jan 17, 2017 · 6 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏

Comments

@lucaswoj
Copy link
Contributor

lucaswoj commented Jan 17, 2017

migrated From mapbox/DEPRECATED-mapbox-gl#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

@1ec5 1ec5 added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jan 17, 2017
@stevage
Copy link
Contributor

stevage commented Feb 1, 2017

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?

@joptimus
Copy link

joptimus commented Mar 2, 2017

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

@leehoss
Copy link

leehoss commented May 1, 2023

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

@fr-an-k
Copy link

fr-an-k commented Apr 28, 2024

+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
Copy link

fr-an-k commented Apr 28, 2024

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
Copy link

fr-an-k commented Apr 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏
Projects
None yet
Development

No branches or pull requests

6 participants