-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
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. |
@HarelM I assume you mean adding to |
Yes, create a style with a few building in a multipolygon and use a terrain from other tests to show that the buildings don't have the same elevation. |
CC: @louwers note for parity. Should be excluded as it used terrain. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3841 +/- ##
==========================================
- Coverage 87.57% 87.46% -0.12%
==========================================
Files 242 242
Lines 33082 33081 -1
Branches 2167 2180 +13
==========================================
- Hits 28973 28934 -39
- Misses 3130 3159 +29
- Partials 979 988 +9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the render tests under terrain
since it is related to (and requires) this feature? Then it won't show up as a disparity.
…ygon' into fill-extrusion-elevation-per-polygon
Thanks! |
@HarelM any plans for a bugfix release soon? We would like to get this fix to production as soon as possible... |
Sure, I'll push a release in the next few days. |
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:
![before](https://private-user-images.githubusercontent.com/1871392/313006593-100b4654-aa9e-4a56-8d1b-e65c2281bd08.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwODkzNzQsIm5iZiI6MTcyMDA4OTA3NCwicGF0aCI6Ii8xODcxMzkyLzMxMzAwNjU5My0xMDBiNDY1NC1hYTllLTRhNTYtOGQxYi1lNjVjMjI4MWJkMDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDRUMTAzMTE0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjIwOTM3NTE1OTY1OWQyNGE3NDA4ZGQ0NGRjZjhhYmU0NWU5YWE2NjhlMmM1YmQ3Mjc5NTZmZGZmYjkzN2MxNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.RCnidLG05V4xF-Rgw-o7TPMwemqAlaRjx4sMbqbxcgM)
After:
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