[GRASS-dev] [GRASS GIS] #2637: Get direction raster in clockwise degrees starting from the North

GRASS GIS trac at osgeo.org
Thu Mar 26 02:57:42 PDT 2015


#2637: Get direction raster in clockwise degrees starting from the North
-------------------------+--------------------------------------------------
 Reporter:  cgravelm     |       Owner:  grass-dev@…              
     Type:  enhancement  |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.1                    
Component:  Raster       |     Version:  7.0.0                    
 Keywords:               |    Platform:  MacOSX                   
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by hellik):

 Replying to [comment:3 neteler]:
 > Replying to [comment:1 annakrat]:
 > > You can just use r.mapcalc "angle_cw = -angle_ccw + 450", this will
 give you what you need. It outputs angles from 90 to 450, but that's
 typically not a problem.
 >
 > ... or you solve it with an if() condition.

 taken from a python script


 {{{
 grass.mapcalc("$outmap = if( $cartesian == 0, 0, if( $cartesian < 90, 90 -
 $cartesian, 360 + 90 - $cartesian) )",
     outmap = r_aspect_compass,
     cartesian = r_aspect)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2637#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list