osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.67k stars 1.02k forks source link

Colour contour lines and Hillshade maps #6636

Closed val24 closed 4 months ago

val24 commented 5 years ago

Hello, I do some ski touring and avalanche risks depend on the steepness of the slopes (among other things). It would be great to have a possibility to visualise the different slope steepness through different colours with an easy able / disable option and / or a way to set the level of transparency of that information. I hope my request was clear enough. Thanks for this great app which I use a lot when hiking. Val

scaidermern commented 5 years ago

I hope you will stick to official sources regarding avalanche risk during your tours. While a better visualization of slope steepness sounds interesting your use case sounds wrong.

val24 commented 5 years ago

Hello, I take my information from the french BRA (Bulletin des Risques d'Avalanche) which shows past snow falls and weather conditions (among which temperature, iso 0°C, and wind conditions) as well as the differences according to altitude, and orientation of the slopes, but it also mentions if the risk is majored in steeper slopes (mostly above 30° in angle) and if the main risk is spontaneous avalanches or due to skier weight on the snow. Thanks for your answer.

Le vendredi 8 mars 2019, Alexander Heinlein notifications@github.com a écrit :

I hope you will stick to official sources regarding avalanche risk during your tours. While a better visualization of slope steepness sounds interesting your use case sounds wrong.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.< https://ci3.googleusercontent.com/proxy/R4gWw9hOx-JV2D0CIOO9qqAD84LXEywSjEle_IQnpM04IpJC352qV6JRyY0bolCR2YYZ61zH_vhFcG1OPGcdnllvh2T768IpoefM2cAAIFtJpQ3TiFtP1XPv1qk8jXbegooWIhOytlqeWhDyO5_FxbC0Gw=s0-d-e1-ft#https://github.com/notifications/beacon/AZF7qDNH1PvqCovK7mdr8lMsNH3IhdIsks5vUgISgaJpZM4bkKxR.gif>

val24 commented 5 years ago

Hello again, The only information I don't have in direct reading either on the BRA or on OsmAnd is the angle of the slopes around me to be able to avoid the most dangerous areas (I can measure the slope where I am, but not the ones above me). And if I have any doubt I don't go ski touring or change my route). Thanks again for taking time to read my messages. Valérie

Le vendredi 8 mars 2019, Valérie Barré v.barre@laposte.net a écrit :

Hello, I take my information from the french BRA (Bulletin des Risques d'Avalanche) which shows past snow falls and weather conditions (among which temperature, iso 0°C, and wind conditions) as well as the differences according to altitude, and orientation of the slopes, but it also mentions if the risk is majored in steeper slopes (mostly above 30° in angle) and if the main risk is spontaneous avalanches or due to skier weight on the snow. Thanks for your answer.

Le vendredi 8 mars 2019, Alexander Heinlein notifications@github.com a écrit :

I hope you will stick to official sources regarding avalanche risk during your tours. While a better visualization of slope steepness sounds interesting your use case sounds wrong.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.< https://ci3.googleusercontent.com/proxy/R4gWw9hOx-JV2D0CIOO9qqAD84LXEywSjEle_IQnpM04IpJC352qV6JRyY0bolCR2YYZ61zH_vhFcG1OPGcdnllvh2T768IpoefM2cAAIFtJpQ3TiFtP1XPv1qk8jXbegooWIhOytlqeWhDyO5_FxbC0Gw=s0-d-e1-ft#https://github.com/notifications/beacon/AZF7qDNH1PvqCovK7mdr8lMsNH3IhdIsks5vUgISgaJpZM4bkKxR.gif>

jroulleau commented 4 years ago

I'll second this request. The use case is correct and follows best practice for anyone travelling in the mountains in winter away from secured areas. The ability to easily identify on the map slopes steeper than 30, 35 and 40 degrees is a great help to prepare a tour that avoids potentially dangerous slopes based on the current conditions. Ski tourers already do that by measuring the distance between contour lines on paper maps and calculating the slope. This is tedious and not always very accurate. A quick visualisation on mobile the night before in the hut would help plan a safe tour for the following day. This is always used in conjunction with additional information about snow condition, weather forecast etc.

jroulleau commented 4 years ago

User story: As a ski tourers, I want to easily be able to identify slopes steeper than 30, 35and 40 degrees, so that I can plan a safe tour based on current snow conditions.

yokto commented 4 years ago

Examples of what this kind of maps look like. switzerland: https://map.geo.admin.ch/?lang=en&topic=schneesport&bgLayer=voidLayer&layers=ch.swisstopo.pixelkarte-farbe-winter,ch.swisstopo.hangneigung-ueber_30,ch.swisstopo-karto.hangneigung,ch.bafu.wrz-jagdbanngebiete_select,ch.bafu.wrz-wildruhezonen_portal,ch.swisstopo.schneeschuhwandern,ch.swisstopo-karto.schneeschuhrouten,ch.swisstopo-karto.skitouren,ch.swisstopo.skitourenkarte-50.metadata,ch.bav.haltestellen-oev&layers_visibility=true,true,false,true,true,true,true,true,false,false&layers_opacity=0.85,0.5,0.2,0.6,0.6,0.7,0.8,0.8,1,1&catalogNodes=2352&E=2644473.54&N=1153746.84&zoom=8 austria: https://www.openslopemap.org/karte/

scaidermern commented 4 years ago

The request for steepness visualization is also part of #2349.

cycore commented 3 years ago

the same user story was described again in #9283

vascotenner commented 1 year ago

Summary from https://github.com/osmandapp/OsmAnd/issues/9283:

My usecase is as follows. I use these slope maps to estimate the avalanche danger when doing off-track skiing. In the most common used risk estimation framework (based on prm designed by Werner Muenter) three slope classes are distinct:

[30, 35)
[35, 40)
[40, 90)

For this reason many web based maps have a winter map showing these slopes, like the swiss maps , the french IGN maps, the outdooractive and bergfex maps. They all use the same colorscale for these maps.

Map data availability This map-data is already present in the current osmand app, but is needs to be rendered differently. Possibily as a a separate layer: slope classes (instead of slopes). The size of the datasets will be very limited, as it only contains 4 values.

For europe, terrain data with a resolution of 25m is freely available. When needed, I can assist in parsing this data.

There exists also a dataset with 1m resolution, but I do not know how to access it, and what the licenses are.

Example from swisstopo image

vascotenner commented 1 year ago

Earlier contributions have been done by: @veliymolfar and it seems that @vshcherb is also well informed.

What would be needed to implement this addition in terms of: decisions, programming? Who could help with that?

vshcherb commented 5 months ago

To test:

To do:

vascotenner commented 5 months ago

@vshcherb thank you for picking this up.

I try to install the test version. I tried first to unpack the zip, but then the off file is not registered with Osmand+ on my phone, and I do not know how to import it. The off.zip is registered, and I can open that with Osmand+. However, I do not know how to test. It does not show up in plug-ins, and also not in map styles/terrain.

daxid commented 5 months ago

@vshcherb thank you for picking this up.

I try to install the test version. I tried first to unpack the zip, but then the off file is not registered with Osmand+ on my phone, and I do not know how to import it. The off.zip is registered, and I can open that with Osmand+. However, I do not know how to test. It does not show up in plug-ins, and also not in map styles/terrain.

Hi, you should extract the osf file and simply open it with OSMAnd. It will install the plugin.

I can see it in my plugin list but I cannot see what the plugin is actually doing.

cycore commented 5 months ago

You need to wait for the next version that contains the code changes from #19872 or install the nightly build from https://osmand.net/docs/technical/build-osmand/osmand-builds#android-nightly-builds-nightly . If you try the plugin in that version, you should see two new entries in the topo color scheme drop down. In addition to Hillshade and Slope, there appears Hillshadetest and Slopetest. So far, the new modes do not actually change the coloring.

vshcherb commented 5 months ago

Forgot to post a comment ... Now it works with same cache as hillshade / slope (we need to improve cache still). Though it works, so if you select new custom style you will see new rendering scheme applied on Nightly Android. So please first clean up cache

cycore commented 5 months ago

I tested it by clearing the cache and can confirm, that the new color scheme is applied.

Then I modified the plugin myself, to add another color scheme for avalanche relevant slopes, as described in the post above by @vascotenner https://github.com/osmandapp/OsmAnd/issues/6636#issuecomment-1427025780 I added a file clr_avalanche.txt with these colors:

0,255,255,255,0
29.999,255,255,255,0
# yellow 
30,242,229,10,255
34.999,242,229,10,255
# orange
35,244,111,36,255
39.999,244,111,36,255
# red
40,222,5,91,255
44.999,222,5,91,255
# violet
45,200,137,187,255

It appears to work somehow. However, the slope values are far from accurate and it shows up a lot less dangerous than it is in reality. I added screenshots for comparison from

The skiable region north and bit east of the peak Gabler should show up as mostly safe (<30°) with some areas in yellow (30-35°). Is the DEM not accurate enough for this use case?

my avalanche color scheme integrated slope color scheme
avalanche layer from Alpenvereinaktiv slope layer from openslopemap.org
skitourenguru.ch
xmd5a2 commented 5 months ago
I've manually made slope map from our source geotif data using QGIS and @cycore scheme: No smooting Smoothing
Screenshot_2024-05-17_14-32-22 Screenshot_2024-05-17_14-32-50
cycore commented 5 months ago

that looks great and like something I could work with while being out in the mountains! (the purple color which I took from the swiss maps turned out to be a bit pale).

So the DEM from the source geotif is accurate enough. But how to get the same picture within OsmAnd? Is it getting smoothed or downscaled too much during the processing?

xmd5a2 commented 5 months ago
I've tried to increase our tifheightmap (3D terrain maps used in app, it is baked from original geotiffs) zoom from 14 to 15 (results in resolution increase) for a test. Looks like it is much better that zoom 14 for all Europe at least but file size is 3-4 times larger that before. Zoom 14 Zoom 15
Screenshot_20240517_120338_OsmAnd Nightly Screenshot_2024-05-17-16-03-12-732_net osmand plus
cycore commented 5 months ago

This looks a bit more detailed, however, it is still not showing those relevant yellow areas along the track north east of the peak Gabler. They are visible in your QGIS image. Would that mean you would have to increase the zoom and file size even more? maybe in this specific avalanche use case with only 5 colors, a precalculated raster tile approach might be more efficient regarding total file size.

vshcherb commented 5 months ago

Today we've introduced color palette for user defined (https://github.com/osmandapp/OsmAnd-resources/tree/master/color-palette). Task is not complete yet but should be ready to try. Files from color palette will be available in user folder (for export / import and editing). For example:

  1. slope_default.txt is responsible for colors for Slope Terrain
  2. slope_avalanche.txt is responsible for colors for Terrain Avalanche (new item will be added to the list)
  3. route_slope_default.txt is responsible for colors for route in slope
  4. height_altitude_0_200.txt is a new file which will color Terrain with colors of absolute altitude (so it should be a range of files that could be applicable for different regions) - dynamic scale is not planned yet.

We plan to improve selection for user palettes in settings and create plugins with some predefined palettes. Though we don't plan for now to create editor for the palette itself, probably later

xmd5a2 commented 5 months ago

https://github.com/osmandapp/OsmAnd-resources/commit/4bb07975e3f2757583c777a3a165154c68e43d98 Some color schemes added including avalanche. However we need to increase 3D height maps zoom at least to 15 to provide adequate details.