openstreetmap-americana icon indicating copy to clipboard operation
openstreetmap-americana copied to clipboard

Add hill-shading to expose terrain

Open adamfranco opened this issue 2 years ago • 6 comments

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 avatar Feb 09 '23 15:02 adamfranco

#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.

claysmalley avatar Feb 09 '23 16:02 claysmalley

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

ZeLonewolf avatar Aug 14 '23 19:08 ZeLonewolf

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

ZeLonewolf avatar Aug 27 '24 19:08 ZeLonewolf

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,[^dem] 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.

[^dem]: A raster DEM layer is still a 2D terrain layer, not a 3D terrain layer.

1ec5 avatar Aug 28 '24 00:08 1ec5

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.

ZeLonewolf avatar Aug 28 '24 00:08 ZeLonewolf

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 avatar Aug 28 '24 04:08 1ec5