[gdal-dev] gdal_calc.py IF ELSE Condition

Antonio Falciano afalciano at yahoo.it
Thu Jun 30 10:33:00 PDT 2016


Il 30/06/2016 15:47, Gabriele N. ha scritto:
> Ciao Antonio.
>
> @arctan I think is ok.
> It works but there are many negative values...I must investigate :)
>
> Meanwhile .... thanks

Gabriele,
the previous expression has some errors yet: two parenthesis and a
conversion are missing. This should be the right one:

--calc="(degrees(arctan(A/B))+180)*(A>0)+(90-degrees(arctan(A/B)))*(A<=0)"

where the numpy "degrees" function is used to convert from radians to
degrees more elegantly than before. Tested on GDAL 2.1.0.

ciao
Antonio

-- 
Antonio Falciano
http://www.linkedin.com/in/antoniofalciano


More information about the gdal-dev mailing list