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 hill-shading to expose terrain #780

Open
adamfranco opened this issue Feb 9, 2023 · 6 comments · May be fixed by #1157
Open

Add hill-shading to expose terrain #780

adamfranco opened this issue Feb 9, 2023 · 6 comments · May be fixed by #1157
Labels
enhancement New feature or request maplibre Needs maplibre feature or expertise

Comments

@adamfranco
Copy link
Collaborator

adamfranco commented Feb 9, 2023

Much of America (and the world's) most rugged terrain also has the fewest map features. Adding hillshade (aka "hill shade") lets the terrain speak for itself and give context to the peaks, valleys, and ridges that define our landscape.

In addition to continent-scale mountain-range topography, hillshade also helps to highlight why cities might have weird blank gaps in them.

For example, Los Angeles without hillshade just has some large gaps. Why are there the blank areas without even parks?
https://zelonewolf.github.io/openstreetmap-americana/#map=12.01/34.15464/-118.32441
image

When terrain and topography is highlighted by hillshade (even without contour lines which add visual noise) it becomes much more obvious to the map viewer why roads and developed areas bend around a spot:
https://www.openstreetmap.org/#map=13/34.1471/-118.3514&layers=Y
image

There may be a number of techniques that could allow adding hillshades, from translucent raster PNGs served by a separate service, to hillshades dynamically generated in Maplibre from a digital elevation map (DEM).

Ideas to consider:

  • Where does the hillshade fit in the feature stack?
    I'm thinking that an ideal hillshade would be a grayscale translucent layer that would be placed above the landcover, landuse, water, and park layers (shading them), but be below roads, buildings, and POIs (keeping them un-shaded).
  • Multi-directional hillshade can look better than than single light-source shading.

Other discussions:

Resources:

@adamfranco adamfranco added enhancement New feature or request maplibre Needs maplibre feature or expertise labels Feb 9, 2023
@claysmalley
Copy link
Member

#341 was an experiment with 3D terrain, which would satisfy the same purpose, but in a more resource-intensive way. In the long-term future I think the option to switch between 3D terrain and hillshaded 2D would be preferable.

@ZeLonewolf
Copy link
Member

An additional terrain source noted on Slack is:
https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png

@ZeLonewolf
Copy link
Member

OSM US is working on a hillshade layer, see osmus/tileservice#16

@1ec5
Copy link
Member

1ec5 commented Aug 28, 2024

FYI, the OSMUS hillshade layer in progress is a raster tileset in JPEG format, so it won’t be quite as versatile as a raster DEM tileset,1 but the client would be able to render it without as much CPU usage. The styling limitations should be fine as long as the layer is muted enough, but there’s probably a natural tension between what an outdoors-focused style and a transportation-focused style would want in terms of terrain exaggeration. The other limitation is that the shading has a fixed light source, unless raster DEM.

Footnotes

  1. A raster DEM layer is still a 2D terrain layer, not a 3D terrain layer.

@ZeLonewolf
Copy link
Member

I was thinking that this could be something that only appears in parts of the map where there isn't much else. In other words, only show where it's really rugged, if that's technically feasible. It may not look right for our purpose but worth exploring.

@1ec5
Copy link
Member

1ec5 commented Aug 28, 2024

That’s what decreasing the exaggeration would do in a raster DEM layer. We could also vary the exaggeration by zoom level. With a JPEG layer, we could tune the opacity and vary it by zoom level, but there isn’t any mechanism for varying the opacity from region to region.

@1ec5 1ec5 linked a pull request Sep 20, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maplibre Needs maplibre feature or expertise
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants