-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
client-side terrain: scale slope calculations by latitude #4807
Comments
Thanks @ajashton for capturing in a ticket. Very interesting stack exchange article! I think per-pixel basis might be more trouble than its worth but I don't think per-tile scaling would be too difficult. @kkaefer let me know if you have thoughts on this or if you have explored any of these options previously. |
I haven't explored any of this. It might be preferable to do per-pixel, since we could use varying interpolation, and enable this effect for z0 tiles as well by having 4 triangles, 2 for the northern hemisphere and two for the southern hemisphere that'd allow us to compute the latitude for every pixel. If we do it per tile, we might end up with seams at the tile boundaries, in particular for low zoom level tiles. |
An option in the middle would be to calculate adjustment at the top and the bottom of a tile and then interpolate (e.g. linearly) in each pixel. This should be cheaper than per-pixel |
@mollymerp @kkaefer I brought this up recently in chat but figured I should capture details in a ticket.
Slope calculations for terrain visualization from mercator-projected tiles should ideally to take into account the varying scale along latitude. The ground distance covered by 1 pixel in mercator shrinks as you move away from the equator, so hills at extreme latitudes will appear more flat than they really are if this is not accounted for.
This StackExchange answer explains the situation well and includes some math that can be used to adjust the terrain visualization to be more accurate.
Options:
The text was updated successfully, but these errors were encountered: