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

Turn on terrain 3d #341

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Turn on terrain 3d #341

wants to merge 6 commits into from

Conversation

wipfli
Copy link
Contributor

@wipfli wipfli commented May 21, 2022

Hey americanas! This is just a little show case for the terrain 3d feature in MapLibre GL JS v2.2.0-pre.2. Uses
the MapLibre demo tiles.

This should not be merged, just wanted to share the nice 3D stuff...

@claysmalley claysmalley marked this pull request as draft May 21, 2022 21:29
@claysmalley
Copy link
Member

Incredible!

Screenshot from 2022-05-21 17-34-58
Screenshot from 2022-05-21 17-37-09

@wipfli
Copy link
Contributor Author

wipfli commented May 21, 2022

@wipfli
Copy link
Contributor Author

wipfli commented May 21, 2022

Demo now uses global terrain tiles from @acalcutt please let me know if I should take that down, Andrew! https://wipfli.github.io/openstreetmap-americana/#4/40.5/-94

@wipfli
Copy link
Contributor Author

wipfli commented May 21, 2022

image

@acalcutt
Copy link

I don't mind, but I wouldn't do it long term. My internet stability isn't great here unfortunately so it may be unavailable at times.

I can offer my full planet mbtiles file if someone wanted to host it (it is 427GB) I just regenerated it so it is no longer missing a chunk of greenland, so now it actually IS full planet. I have also tested converting it to a pmtiles file, which was slightly smaller if someone wanted that (but it seemed a bit slower)

@acalcutt
Copy link

I still have the first version of the terrainrgb file here ( https://drive.google.com/drive/folders/1tvJSr_4wq7kaxe1hOOGAK_oDWFYrMTcx?usp=sharing ) , but that one is missing the chunk of greenland

I plan to upload the new copy soon, but theres no reason this old copy couldn't be used now and replaced once I get it uploaded. Its so big I usually upload it from work where the internet is stable...lol

@acalcutt
Copy link

@ZeLonewolf
Copy link
Member

This looks amazing and thanks @wipfli and @acalcutt for showing us the art of the possible. I personally think it would be a great fit for our style have hill shading, to "fill in" parts of the map that would otherwise be quite boring. It does seem that performance is a significant challenge with the current demo, so we would need to obtain hosting more robust than what is shown in this demo. Can you share some specs on what you're currently used to host the mbtiles? a 0.5TB mbtiles file is within the realm of possible.

@acalcutt
Copy link

acalcutt commented May 23, 2022

I am only running this on a 8 core / 16Gb memory virtual server, though tileserver-gl doesn't really make use of that. My main issues here is I only have a 10Mb upload speed, so it shouldn't take much to do better than that.

I am running Debian 11 with my maplibre version of tileserver-gl running as a systemd service and running it behind haproxy
https://github.com/acalcutt/tileserver-gl/

@adamfranco
Copy link
Collaborator

This looks fabulous! Do you have any sense about how performance of this would compare to a 2D hill-shade layer? I'm really looking forward to getting hill-shade in Americana and if 3D terrain is a reasonable way to get that (and also get 3D!) then that would be super snazzy. That said, if 3D terrain adds significantly larger processing/GPU requirements on the client side, then maybe a 2D hill-shade layer would also be beneficial.

I could also imagine that a 2D hill-shade layer might have higher resolution or fine-grain detail, but that's an unknown at this point.

@acalcutt
Copy link

acalcutt commented May 23, 2022

On my tileserver I have this test style which uses a 2D hillshade raster made from the JAXA DEM images files
https://tiles.wifidb.net/styles/WDB_ELEV/#9.35/47.214/8.8954

Which can be compared with main main style, which uses the dynamic maplibre hillshade, using the TerrainRGB file made from the same JAXA DEM image files
https://tiles.wifidb.net/styles/WDB_OSM/#9.35/47.214/8.8954

On my site map at https://wifidb.net/wifidb/opt/map.php?func=wifidbmap , I leave Terrain off by default just because it is VERY resource heavy. However, I included the TerrainControl button so if the user wants it, they can optionally turn it on.

That's really just hillshade though, which isn't a new feature. 3D Terrain needs the same source (TerrainRGB or Terrarium), so once you have that source for one thing It makes sense to have it for the other.

I personally like how the dynamic hillshade looks better. It is much sharper and you don't have to worry about blending as much because it just gets drawn on top.

EDIT: Also, I know I commented on the pitch control above. I wanted to mention the reason for that is without a pitch, the 3d terrain looks a lot like regular hillshade, and it is a lot harder to see the 3d effect of it. I always make sure to include pitch in my navigation control if I want to show off terrain (so people like me with a laptop and touchpad can actually change the pitch and see it)

@acalcutt
Copy link

acalcutt commented May 28, 2022

I've updated my full planet mbtiles made from the JAXA DEM images and put them on my google drive if anyone is interested. They can be downloaded here https://drive.google.com/drive/folders/1Uo5xyFd8it7UH3pSmBiWP4lfZdM9OmhA?usp=sharing

jaxa_terrainrgb.mbtiles - Is a full planet TerrainRGB file made with gdal and rio rgbify. This can be used with the new terrain features of maplibre or with the older hillshade features. (example here).

jaxa_color.mbtiles - A full planet color relief map created using gdaldem color-relief (example here)

jaxa_hillshade.mbtiles - A full planet hillshade map created with gdaldem hillshade. I preferer to use the TerrainRGB dynamic hillshade over this file, but I updated it anyway. (example here)

As you can see from the examples above, I have fixed the missing chunk of Greenland that the last version of these files had.

@ZeLonewolf
Copy link
Member

The key here is to understand what resource requirements we need to acquire to have hill shading in Americana. I'm willing to conduct a limited experiment to determine what those minimums are, but ultimately we'll be looking for donated resources for a general purpose map and/or an OSM US American map style.

What I'm hearing is that we want to host the jaxa_hillshade.mbtiles (200Gb) on a server with significant download speeds.

I can rent a t4g.nano from AWS which has 0.5G ram, 2 vCPUs and 5Gbit max download speed. Would that be sufficient for a performance test?

@acalcutt
Copy link

acalcutt commented May 28, 2022

The example in this pr is using only jaxa_terrainrgb.mbtiles (427.42 GB)

This is a TerrainRGB file (Zoom 0-12) that can be used with maplibre hillshade features ( https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#hillshade ) or with the new 3d terrain features ( https://maplibre.org/news/2022-05-20-terrain3d/#12/47.27574/11.39085/0/52 )

@ZeLonewolf
Copy link
Member

ZeLonewolf commented Jun 12, 2022

Note that I've been unable to test this because I've been unable to download the file onto my AWS VM so far.

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.

5 participants