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

GRASS GIS trac at osgeo.org
Mon Sep 10 17:04:21 PDT 2012


#1057: r.slope.aspect: add -c option
----------------------------+-----------------------------------------------
 Reporter:  paoloC          |       Owner:  grass-dev@…              
     Type:  enhancement     |      Status:  new                      
 Priority:  normal          |   Milestone:  7.0.0                    
Component:  Raster          |     Version:  svn-trunk                
 Keywords:  r.slope.aspect  |    Platform:  Unspecified              
      Cpu:  Unspecified     |  
----------------------------+-----------------------------------------------

Comment(by hamish):

 see code in addons/grass6/display/d.barb/main.c

 {{{
     type_opt = G_define_option();
     type_opt->key = "aspect_type";
     type_opt->type = TYPE_STRING;
     type_opt->required = NO;
     type_opt->answer = "cartesian";
     type_opt->options = "cartesian,compass";
     type_opt->description = _("Direction map aspect type");
 }}}

 {{{
 /* aspect flavours */
 #define TYPE_GRASS 0
 #define TYPE_COMPASS 1
 ...
     if (strcmp(type_opt->answer, "compass") == 0)
         aspect_type = TYPE_COMPASS;
     else
         aspect_type = TYPE_GRASS;
 ...
     angle = (aspect_type == TYPE_GRASS ? theta : 90 - theta);
 }}}


 Hamish

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



More information about the grass-dev mailing list