[GRASS-SVN] r56222 - grass/trunk/vector/v.sample

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 12 10:12:16 PDT 2013


Author: martinl
Date: 2013-05-12 10:12:15 -0700 (Sun, 12 May 2013)
New Revision: 56222

Modified:
   grass/trunk/vector/v.sample/main.c
Log:
v.sample: use G_OPT_R_INTERP_TYPE & Rast_option_to_interp_type


Modified: grass/trunk/vector/v.sample/main.c
===================================================================
--- grass/trunk/vector/v.sample/main.c	2013-05-12 17:08:54 UTC (rev 56221)
+++ grass/trunk/vector/v.sample/main.c	2013-05-12 17:12:15 UTC (rev 56222)
@@ -95,12 +95,7 @@
     parm.rast->key = "raster";
     parm.rast->description = _("Name of raster map to be sampled");
 
-    parm.method = G_define_option();
-    parm.method->key = "method";
-    parm.method->type = TYPE_STRING;
-    parm.method->required = NO;
-    parm.method->description = _("Interpolation method");
-    parm.method->options = "nearest,bilinear,bicubic";
+    parm.method = G_define_standard_option(G_OPT_R_INTERP_TYPE);
     parm.method->answer = "nearest";
 
     parm.z = G_define_option();
@@ -118,12 +113,7 @@
 
     sscanf(parm.z->answer, "%lf", &scale);
 
-    if (parm.method->answer[0] == 'c')
-	method = CUBIC;
-    else if (parm.method->answer[0] == 'b')
-	method = BILINEAR;
-    else
-	method = NEAREST;
+    method = Rast_option_to_interp_type(parm.method);
     
     G_get_window(&window);
 



More information about the grass-commit mailing list