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 hillshading and contour lines #78

Merged
merged 7 commits into from
Sep 10, 2024

Conversation

jake-low
Copy link
Collaborator

This PR includes some scripts to generate hillshade and contour line tilesets from Mapzen's global DEM data. I've run these scripts on my machine to produce tilesets that cover Washington State, and put those in the S3 bucket where the existing tiles are served from.

I also added the hillshade and contours to the basemap stylesheet, and made minor tweaks to the park-fill and park-outline style layers (park-fill was fully opaque; I made it semi-transparent so you can see the hillshades and contours underneath). Other parts of the stylesheet may need tweaking too, and the changes I made were very quick and dirty, and could certainly be finetuned more.

You can try it out for yourself by pulling down this branch, running npm run serve, and then panning to somewhere in Washington.

Some things I'd like feedback on:

  • How do you feel about the overall readability of the map? Does this change support the design goals?
  • Do the contour line intervals feel appropriate at various zoom levels?

Once you're happy with the look of the results I can work on spinning up a server in AWS to crank out tiles for the whole world. I think it'll require minor modifications to the scripts (mercantile doesn't support enumerating tiles for an irregularly shaped region, so I'll write some custom code to avoid wasting a bunch of compute on tiling the oceans). Shouldn't be too hard though.

Before:
Screenshot 2024-08-26 at 12 06 36 PM

After:
Screenshot 2024-08-26 at 12 21 22 PM

Closes #51

@quincylvania
Copy link
Contributor

Thanks @jake-low, this looks amazing! The terrain really brings the map together.

It will definitely take some cartography work to get the look we want. The terrain is useful but we don't want information overload to impact readability, especially on the analysis views. The protected areas were intentionally opaque since otherwise overlapping translucent areas create unintentionally stacked fills. (There is an open issue at MapLibre for setting the transparency of an entire layer, which would fix the situation.)

Can you move the terrain folder to https://github.com/osmus/tileservice? That repo is for all our tile work, not just stuff that runs on our render server. The terrain tiles will be useful for various maps, not just OTM.

Also, you can push these types of branches to OSM US repos directly instead of forks if you want. Makes things a bit easier.

@zekefarwell
Copy link

This looks fantastic! Woohoo, @jake-low!

park-fill was fully opaque; I made it semi-transparent so you can see the hillshades and contours underneath

The protected areas were intentionally opaque since otherwise overlapping translucent areas create unintentionally stacked fills.

Maybe it would work to flip the order? Make the hillshade layer the semi-transparent one and put it above the opaque park fill layer?

@jake-low
Copy link
Collaborator Author

Thanks!

Maybe it would work to flip the order? Make the hillshade layer the semi-transparent one and put it above the opaque park fill layer?

This is a good idea, I'll give that a try. It'll have the unwanted effect of muting the colors of the park areas (and anything else we move underneath the hillshade) but I can compensate for that by increasing the saturation of those layers. Maybe someday MapLibre will support blend modes like multiply, that would be really handy for hillshade layers.

@jake-low
Copy link
Collaborator Author

Take 2: this time the park-fill layer is fully opaque and the hillshade layer is above it at 50% opacity. I adjusted the colors on the park fill and on the background so that they'd appear about the same when the (mostly-white) hillshade rasters were overlaid on top, and I think I got reasonably close, but could probably tweak them a bit further.

I haven't pulled the terrain/ scripts out of this PR yet and moved them over to osmus/tileservice but I will.

Before:
Screenshot 2024-08-27 at 5 42 05 PM
After:
Screenshot 2024-08-27 at 5 47 38 PM

@quincylvania
Copy link
Contributor

@jake-low This looks really really good. I'd say the styling is ready to merge as soon as we have the full tile sets posted. (We don't have to get it exact, we're constantly tweaking the carto.)

The hillshade effect provides a pretty strong "fill" effect at these
low zooms, and showing state/province boundaries was creating too much
visual noise (especially in countries with many small subdivisions).
@jake-low
Copy link
Collaborator Author

jake-low commented Sep 9, 2024

Hillshade and contour tilesets are finished building for the planet.

I also made some tweaks to the styling, namely:

  • moved the landuse-exclusion (red military areas) layer below the hillshading, similar to what I had already done for park-fill
  • hid admin-2 (state/province) boundaries at zoom < 3 - when layered on top of the hillshading these were causing too much visual noise at very low zooms IMHO

Terrain tileset building scripts have been removed from this PR and moved over to osmus/tileservice instead. See osmus/tileservice#18

Screenshot 2024-09-09 at 1 56 21 PM
Southern Utah
Screenshot 2024-09-09 at 2 00 36 PM
Maui, Lānaʻi and Molokaʻi
Screenshot 2024-09-09 at 2 07 31 PM
Mont Blanc
Screenshot 2024-09-09 at 2 06 43 PM
Torres del Paine
Screenshot 2024-09-09 at 2 08 25 PM

@jake-low jake-low marked this pull request as ready for review September 9, 2024 21:19
@quincylvania quincylvania merged commit e92d900 into osmus:main Sep 10, 2024
@quincylvania
Copy link
Contributor

Thank you @jake-low! I'm super excited for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contour lines
3 participants