[GRASS-dev] Re: [gdal-dev] gdaldem hillshade directions / GRASS
schut at sarvision.nl
Tue May 25 03:37:58 EDT 2010
On 05/20/2010 01:38 AM, Even Rouault wrote:
> I've taken some time to experiment a bit with GRASS and GRASS behaviour is
> correct of course, so sorry for the noise.
> I've finally identified why gdaldem (and initially Matt's hillshade utility)
> got it wrong. GRASS r.mapcalc atan(x,y) function has its parameters reversed
> in comparison to C atan2() used by GDAL : atan(x,y)=atan2(y,x)....
> So the aspect computation was wrong which could also be seen as a wrong
> interpretation of the azimuth parameter. But for the particular value of
> az=315deg, the beauty of trigonometry makes it such that cos(az-pi/2-atan2
> (y,x)) = cos(az-pi/2- atan2(x,y))...
> Fixed as ticket http://trac.osgeo.org/gdal/ticket/3586
Thanks for looking further into this and fixing it. I'll remove my
workaround code and update my gdal.
More information about the gdal-dev