Open thuydotm opened 1 year ago
@thuydotm same azimuth and angle correct? Can you run with GDAL from the CLI and then post the command?
@brendancol sure, here is the command:
gdaldem hillshade /private/var/folders/pf/9s4nnc0d0z7ghsq4f972gd9h0000gn/T/processing_AitUZB/665b1e0551a047d181859f56c34e8ea3/OUTPUT.tif /private/var/folders/pf/9s4nnc0d0z7ghsq4f972gd9h0000gn/T/processing_AitUZB/4009f64aa4fc4ed38fcb7f9590a0dea5/OUTPUT.tif -of GTiff -b 1 -z 1.0 -s 1.0 -az 225.0 -alt 25.0
@thuydotm I think the will require looking at the GDAL slope and aspect functions as well to see how those non-trivial calcs are made:
I'm testing xarray-spatial against QGIS and seeing that when running hillshade on the same input data, the results by xarray-spatial and GDAL/QGIS are very different. Source code for QGIS hillshade can be found at: https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/gdal/hillshade.py. This needs more research to see how the algorithm was implemented in QGIS to clearly understand the difference between the 2 libraries.
Input data:
xarray-spatial hillshade:
QGIS/GDAL hillshade