buskerudbyen / cycling-norway

3 stars 2 forks source link

Topography #18

Open tsobuskerudbyen opened 1 year ago

tsobuskerudbyen commented 1 year ago

Can we show some topography on the map, or have a layer based on some of this: https://opentopomap.org/#map=16/59.75300/10.20516 http://opensnowmap.org/#map=15/10.197/59.761&b=snowmap&m=false&h=false

tsobuskerudbyen commented 1 year ago

Is it possible to use e.g. something like this: https://github.com/GIScience/openelevationservice ?

leonardehrenfried commented 1 year ago

This is unfortunately quite hard to do. My default map creation software cannot do it at the moment.

I will do some thinking and will look for alternatives. 🤔

leonardehrenfried commented 1 year ago

I'm going to reach out to my network if there is someone who can help implement this. I'll be back with some info soon.

leonardehrenfried commented 1 year ago

So, I spoke to the hardcore experts and whilst it's quite complicated, it it is possible to do it ourselves.

Image

Instructions

This is much easier. First build a VRT (gdalbuildvrt) with your source elevation data: something like

gdalbuildvrt -srcnodata 0 -vrtnodata 0 -hidenodata dem.vrt *.tif

Then use rio-rgbify to make an .mbtiles: rio rgbify -r 2 -b -10000 -i 0.1 -j 16 --min-z 4 --max-z 12 --format png dem.vrt output.mbtiles Maximum zoom level 12 seems to be fine. You might want to patch rio-rgbify to avoid nodata artefacts as per this: > https://github.com/mapbox/rio-rgbify/issues/38

You can then style these with the hillshade instructions in MBGL.

leonardehrenfried commented 1 year ago

Note that this requires quite some research on our part so lets discuss this in tomorrow's meeting.

tsobuskerudbyen commented 1 year ago

Thanks for effort here. Guess it is something we can save for later funding. Please just document what you have found and make an estimate on hours of work needed.

BTW. I always thought that Entur had this data in their systems? Guess this is only done for trips and recommendations for where to walk then, and noting is done for displaying the actual elevation. From Entur's presentation: bilde