-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
Elevation per polygon for fill extrusions #3841
base: main
Are you sure you want to change the base?
Elevation per polygon for fill extrusions #3841
Conversation
Thanks for taking the time to look into this! This is only relevant for terrain as it will be kept at 0 for non terrain maps, right? |
|
Also worth making sure is that buildings with multiple parts are presented correctly after this fix. |
I just want to mention I was talking to someone in slack a while back that wanted to keep the heights of separate polygons the same when using terrain ( https://osmus.slack.com/archives/C01G3D28DAB/p1705407931974739 ) . I had suggested they could possibly use the Multipolygon grouping to kind of do what they wanted, but the fix we are trying to use here would break that option for them (like I had mentioned to them at the time) . If you did add an option like the 'fill-extrusion-elevation-per-polygon' it could still allow that kind of use case. |
I think that the default should be that every polygon would be placed in the right place. |
Makes sense to me and it would fix my original issue #3313 , I had just wanted to bring it up because there may be some cases where this isn't wanted, like we talked about around #3313 (comment) . The comment on slack they were trying to make a crude bridge, where the pillars and other pieces needed to be aligned. I think it makes sense that the change in this PR is the default. |
@antonmarsden Can you please add a render test so I can merge this? |
@HarelM I have added a basic test to verify that centroids are created on a per-polygon basis. Have not had much spare time recently, am hoping this is sufficient to move things forward. |
Thanks! I was hoping for a render test, something similar to the screenshot you added, but hopefully simpler. |
This PR is a basic solution to issue #3313, and renders multipolygons at their own centroid's elevation.
It is potentially a breaking change for some edge cases though, and it may be worth introducing a new fill-extrusion style property (e.g., ""fill-extrusion-elevation-per-polygon") to optionally activate this behaviour. Suggestions welcomed :)
CHANGELOG.md
under the## main
section.Before:
After: