[GRASS-dev] Re: [GRASS GIS] #1057: r.slope.aspect: add -c option

GRASS GIS trac at osgeo.org
Thu May 6 12:25:49 EDT 2010


#1057: r.slope.aspect: add -c option
--------------------------+-------------------------------------------------
  Reporter:  paoloC       |       Owner:  grass-dev at lists.osgeo.org
      Type:  enhancement  |      Status:  new                      
  Priority:  normal       |   Milestone:  7.0.0                    
 Component:  Raster       |     Version:  svn-trunk                
Resolution:               |    Keywords:  r.slope.aspect           
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------
Comment (by glynn):

 Replying to [ticket:1057 paoloC]:
 > Is it possible to add a '-c' option to r.slope.aspect in order to get an
 aspect raster map with compass notation (North=360,  East=90, South=180,
 West=270) ?
 >
 > e.g.:
 >
 {{{
 r.mapcalc "aspect_compass=if(isnull(aspect_from_east),null(), \
         if((aspect_from_east<90), 90-aspect_from_east, 360+90-
 aspect_from_east))"
 }}}

 Simpler version:
 {{{
 r.mapcalc "aspect_compass = (450 - aspect_from_east) % 360"
 }}}

 There's no need for an explicit null check, as almost any operation
 involving null returns null.

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


More information about the grass-dev mailing list