[GRASS-SVN] r53966 - grass-addons/grass7/imagery/i.rotate

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 21 22:27:51 PST 2012


Author: ychemin
Date: 2012-11-21 22:27:50 -0800 (Wed, 21 Nov 2012)
New Revision: 53966

Modified:
   grass-addons/grass7/imagery/i.rotate/main.c
Log:
Added rotation angle flag

Modified: grass-addons/grass7/imagery/i.rotate/main.c
===================================================================
--- grass-addons/grass7/imagery/i.rotate/main.c	2012-11-22 05:21:51 UTC (rev 53965)
+++ grass-addons/grass7/imagery/i.rotate/main.c	2012-11-22 06:27:50 UTC (rev 53966)
@@ -37,7 +37,7 @@
     int nrows, ncols;
     int row, col;
     struct GModule *module;
-    struct Option *in, *out;
+    struct Option *in, *out, *n;
     struct History history;	/*metadata */
     int infd, outfd;
     void *inrast, *outrast;
@@ -54,6 +54,13 @@
     /* Define the different options */ 
     in = G_define_standard_option(G_OPT_R_INPUT);
     out = G_define_standard_option(G_OPT_R_OUTPUT);
+    n = G_define_option();
+    n->key = "angle";
+    n->key_desc = "degrees";
+    n->type = TYPE_DOUBLE;
+    n->required = YES;
+    n->description = _("Rotation angle");
+    n->answer = "20.0";
 
     if (G_parser(argc, argv))
         exit(EXIT_FAILURE);
@@ -100,7 +107,7 @@
 	    }
         }
     }
-    double theta=20.0;
+    double theta=n->answer;
     double thetarad=theta*3.1415927/180;
     double costheta=cos(thetarad);
     double sintheta=sin(thetarad);



More information about the grass-commit mailing list