melowntech / workshop

Workshop of Melown 3D stack
10 stars 3 forks source link

How to exaggerate the DEM elevation values? #16

Closed fnicollet closed 6 years ago

fnicollet commented 6 years ago

Hello again, So I have this DEM: image

Which is sampled between 0 and 183. These numbers do not represent the real altitudes. If you want to check on maps, here is a link: https://www.google.fr/maps/@45.1633308,5.7992763,7845a,35y,2.11h,60.32t/data=!3m1!1e3

How can I achieve a better result? I would need to multiply the DEM values by some factor to make it look right. I tried looking at the "mapproxy-tiling" help but there doesn't seem to be such a parameter. Should I do it on the TIFF itself before tiling it with melown? If so, how do you achieve that (some GDAL/melown tool maybe)? Or is there a config value somewhere where I can change to multiply tiff values?

In Cesium, there is a "terrainExaggeration" parameter, see https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Apps/Sandcastle/gallery/Terrain%20Exaggeration.html

Thanks,

ladislavhorky commented 6 years ago

Hi, this is a type of task that should be done completely outside VTS. Generally, the task of VTS is to effectively serve and display the data, rather than support extensive modification or reinterpretation of the input that could be done - usually in more convenient way - elsewhere.

Hint: GDAL supports shift and scale tags (which actually may get supported in VTS in the future) and with a little bit of GDAL magic you can get GDAL to apply those tags to the values in your file.

fnicollet commented 6 years ago

Thanks for the hints :) If anyone runs into the same issues, I solved it by using this commande line:

gdal_translate MNT_PNRC_L93_projected.tif MNT_PNRC_L93_projected_scale.tif -scale 0 183 0 2000 -ot Float32