qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.69k stars 3.02k forks source link

raster Hillshade rendering, confusion altitude/zenith #51178

Open vcloarec opened 1 year ago

vcloarec commented 1 year ago

What is the bug or the crash?

Not sure,but it seems there is a confusion about naming parameter for raster hillshade rendering. Indeed, it appears, that for light direction, altitude is the angle between horizontal and light direction. Zenith is the direction between vertical and the light direction.

For the hillshade rendering, when altitude is 90°, it is like a horizontal light direction: image

Steps to reproduce the issue

Load a DEM raster layer and play with hillshade rendering

Versions

3.28 an master

Supported QGIS version

New profile

Additional context

No response

agiudiceandrea commented 1 year ago

Seems like that to me too.

"Altitude" angle (ore "elevation") should be the angle measured between the horizontal plane and the position of the Sun (0° = raking light parallel to the horizon, 90° zenithal light from the above), while it seems that the "Altitude" parameter is actually 90 - altitude angle, i.e. the zenith angle (0° = zenithal light from the above, 90° raking light parallel to the horizon).

GDAL uses the altitude parameter https://gdal.org/programs/gdaldem.html#cmdoption-alt as it should be: "Altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light."