relief shading for my OpenAndroMap???

Started by hundundhund, March 11, 2014, 12:53:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

panda

#45
Hi Orux,

I just like to ask: is there a reason why hillshading is only added to mapsforge maps?



I also use garmin maps and the contourlines there are very thin and hard to see, so applying hillshade to that would improve

the information about heights and elevation.

Maki

#46
Quote from: "orux"It is difficult to find the right parameters.orux


I can't be sure since I don't know the internals, but I think that the source of the difficulties is the separate rendering for each zoom level. Ideally hillshading should be rendered at the native DEM resolution and then just scaled up/down with a simple bilinear interpolation. Doing so the result is a very smooth yet detailed rendering at every ZL, the only needed setting is opacity, which is best left to the user due to variance in people tastes and map theme contrast.



The current system needs gaussian blur to work around pixelation, but there is no way you can find an ideal setting for every DEM out there (with different grid distances), and you have to chose between blotchy rendering or seams at the edges.



Maki

eartrumpet

#47
I looked at other maps, which are of course not on the fly generated but from tile servers, so it's a slightly invalid comparison.



But to get the idea why I think the hill shading is too dark at the moment and also too detailed I made this comparison:



http://postimg.org/image/nmxzu408v/">



I included also the darkest hill shading of other maps I could find which is hike bike maps and google terrain.



But also these are more blurred and less detailed.

I think the hill shading is a bit too distracting at the moment, I personally prefer a light one which only helps the user to see slopes and hills, but shouldn't be as humpy as it is now.



So more blur and more opacity as in 4umaps, outdooractive or opencyclemap would be very welcome!

Thanks again for your efforts.

orux

#48
Hi all;



I will try to modify the curve I use to give value to each pixel color. Currently it is very simple, is proportional to the cosine of the angle between the normal to the plane with the inclination of the light source. I do this to avoid complex computations, but may consider other formulas.



Then OruxMaps uses multiplication of both layers, using the android native libraries, so I do not know if I can apply some transparency to the shadow layer before.



Currently, the default configuration does not apply shadows, so normal users will not be affected because they will see the mapsforge maps as usual.



Later I will apply the shadows to all types of maps, now it's an experiment.



It is difficult to implement the solution to generate the shadows to the native resolution of the DEM file, and then applied to the corresponding tile.



Perhaps the best solution is to have one or more sqlite maps with shadows applied, and make the composition with the other maps at rendering time.



orux

Maki

#49
Hi Orux,



I have some knowledge, but I'm not a coder, so while I understand the processing limits on a portable device I don't know exactly what happens and what can or cannot be done. However, reasoning on what I see and comparing to my (very limited) GIS experience I don't think the situation is bad at all.



The formula seems ok to me. If you compare the screenshots from Tobias you'll see that's perfectly good in terms of shading. The OM shading looks a lot noisier than the others, but so are contour lines. Tobias is probably using 30m DEMs and the Alps OAM that is based on the same DEMs. The others are probably using 90m DEMs with corresponding contour lines, surely they are smoother, but it's the source data in itself. Plus, yes, they are probably post-processed, but commonly available 30m DEMs have a lot of problems, and they show.



Note also that Google shadows aren't actually that much lighter than yours, but they can take advantage of the fact that roads are drawn on top of the shadow and remain legible also on SE slopes. Unfortunately you can't do that right now, not with OAM at least.



I don't know if there is a direct way to set opacity when doing the multiplication in Android. But in a worst case scenario you can simply lighten up the shadow before the multiplication. I'm doing it right now in Tilemill, if you just translate the 0-255 range to 128-255, the effect is the same as a 50% opacity.


QuotePerhaps the best solution is to have one or more sqlite maps with shadows applied, and make the composition with the other maps at rendering time.


I think that could be a viable solution. The disadvantage is that the user has to manage one more thing, but rendering and postprocessing on a PC gives more opportunities. And in a later phase you can always pre-render those shadow maps on the phone.



Thanks, Maki

eartrumpet

#50
I agree with Maki, the shading is already pretty good, there is only some fine tuning which is still needed. I think Makis idea with a different luminosity range is probably a good solution for the dark slopes.



Maki, you're right, I'm using 1'' DEM data from viewfinderpanorama where available; 3'' DEM looks better for this usage. But it's possible to make 1'' data look good too:



I played a bit around with 1'' and 3'' data and various setting for Relief map resolution, and it seems that with low to very very low settings 1'' looks better, at least at higher zoom levels. Medium to very high don't make much difference to me, all not very pretty for 1'' DEM at level 15.



So smoothing is already kind of included (ZL15):

http://postimg.org/image/hkl7vjbcx/">



But very very low isn't working well at lower zoom levels (ZL11):

http://postimg.org/image/69rpb0z2b/">



So maybe splitting up relief map resolution settings in two separate settings for high and low zoom levels and a custom value where high begins would solve the smoothing problem for 1'' DEM data, and it wouldn't hurt for 3'' DEM data as well.

orux

#51
Hi,



using color values from 64 to 255:



http://postimage.org/">





orux

6745th@web.de

#52
Great!

Thank you all for the professional team working :-)

eartrumpet

#53
Quote from: "orux"Hi,



using color values from 64 to 255:




Thanks, looks very promising!

Maki

#54
Eventually it quit raining and I could test outdoors after playing at home. I think it is still a bit dark especially with low contrast themes, but still way better than before. Making it lighter also makes the imperfections less visible.



I tried with 3" DEMs and it's much smoother, as expected, but it's not because of the lower resolution, it's just that commonly available 1" DEMs are full of artefacts. I made hillshadings from high quality 10m DTM (in QGIS) and they are silky smooth, yet detailed. The problem is that it turns out to be impossible to find a settings that works well across a wide range of zoom levels, but I have to say that when everything matches (no visible seams) the result is very good, so very promising.



One problem I'm seeing is green blotches, especially at higher zoom levels. Those are usually masked by patterns where there is some land-use, but on poorly mapped areas I find them annoying. Maybe a too aggressive JPEG compression artefact?

valleyofdawn

#55
For those of us who haven't been following can you give us shortcuts on how to get this wonderful feature?

Thanks!

Maki

#56
Quote from: "valleyofdawn"For those of us who haven't been following can you give us shortcuts on how to get this wonderful feature?

Thanks!


It's all explained in this thread, except maybe the source for DEMs, that you can download, amongst others, from http://viewfinderpanoramas.org/">//http://viewfinderpanoramas.org/. Unzip and copy them in the "dem" folder, inside the "oruxmaps" folder on your phone. Then activate hillshading in the Mapsforge preference panel, and tweak the parameters in the "relief map" panel.

valleyofdawn

#57
Found it. Wonderful, thanks.

Actually oruxmas automatically downloaded the local DEM data the first time I asked for a 3D map.

Is the quality of that data source inferior to what you are suggesting?

Maki

#58
I don't know what OM downloads, so I can't answer. But I think the original source is mostly the same for all suppliers.