[GRASS-SVN] r58903 - in grass/trunk: include lib/gis lib/raster raster/r.proj raster/r.resamp.bspline raster/r.resamp.interp raster/r.shaded.relief raster/r.viewshed vector/v.surf.bspline

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 6 10:18:40 PST 2014


Author: annakrat
Date: 2014-02-06 10:18:40 -0800 (Thu, 06 Feb 2014)
New Revision: 58903

Modified:
   grass/trunk/include/raster.h
   grass/trunk/lib/gis/parser_standard_options.c
   grass/trunk/lib/raster/interp.c
   grass/trunk/lib/raster/sample.c
   grass/trunk/raster/r.proj/main.c
   grass/trunk/raster/r.proj/r.proj.html
   grass/trunk/raster/r.resamp.bspline/main.c
   grass/trunk/raster/r.resamp.bspline/r.resamp.bspline.html
   grass/trunk/raster/r.resamp.interp/main.c
   grass/trunk/raster/r.resamp.interp/r.resamp.interp.html
   grass/trunk/raster/r.shaded.relief/r.shaded.relief.html
   grass/trunk/raster/r.viewshed/r.viewshed.html
   grass/trunk/vector/v.surf.bspline/main.c
Log:
rasterlib: rename interpolation methods again to use correct names (linear->bilinear, cubic->bicubic)

Modified: grass/trunk/include/raster.h
===================================================================
--- grass/trunk/include/raster.h	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/include/raster.h	2014-02-06 18:18:40 UTC (rev 58903)
@@ -18,8 +18,8 @@
 */
 #define INTERP_UNKNOWN   0
 #define INTERP_NEAREST   1		/* nearest neighbor interpolation  */
-#define INTERP_LINEAR    2		/* linear interpolation            */
-#define INTERP_CUBIC     3		/* cubic interpolation             */
+#define INTERP_BILINEAR  2		/* bilinear interpolation          */
+#define INTERP_BICUBIC   3		/* bicubic interpolation           */
 
 /*** typedefs ***/
 typedef int RASTER_MAP_TYPE;

Modified: grass/trunk/lib/gis/parser_standard_options.c
===================================================================
--- grass/trunk/lib/gis/parser_standard_options.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/lib/gis/parser_standard_options.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -315,12 +315,12 @@
         Opt->type = TYPE_STRING;
         Opt->required = NO;
         Opt->description = _("Sampling interpolation method");
-        Opt->options = "nearest,linear,cubic";
+        Opt->options = "nearest,bilinear,bicubic";
         G_asprintf((char **) &(Opt->descriptions),
-                   "nearest;%s;linear;%s;cubic;%s",
+                   "nearest;%s;bilinear;%s;bicubic;%s",
                    _("Nearest-neighbor interpolation"),
-                   _("Linear interpolation"),
-                   _("Cubic interpolation"));
+                   _("Bilinear interpolation"),
+                   _("Bicubic interpolation"));
         break;
 
 	/*g3d maps */

Modified: grass/trunk/lib/raster/interp.c
===================================================================
--- grass/trunk/lib/raster/interp.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/lib/raster/interp.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -199,11 +199,11 @@
         if (strcmp(option->answer, "nearest") == 0) {
             interp_type = INTERP_NEAREST;
         }
-        else if (strcmp(option->answer, "linear") == 0) {
-            interp_type = INTERP_LINEAR;
+        else if (strcmp(option->answer, "bilinear") == 0) {
+            interp_type = INTERP_BILINEAR;
         }
-        else if (strcmp(option->answer, "cubic") == 0) {
-            interp_type = INTERP_CUBIC;
+        else if (strcmp(option->answer, "bicubic") == 0) {
+            interp_type = INTERP_BICUBIC;
         }
     }
 

Modified: grass/trunk/lib/raster/sample.c
===================================================================
--- grass/trunk/lib/raster/sample.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/lib/raster/sample.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -58,11 +58,11 @@
 	retval =
 	    Rast_get_sample_nearest(fd, window, cats, north, east, usedesc);
 	break;
-    case INTERP_LINEAR:
+    case INTERP_BILINEAR:
 	retval =
 	    Rast_get_sample_bilinear(fd, window, cats, north, east, usedesc);
 	break;
-    case INTERP_CUBIC:
+    case INTERP_BICUBIC:
 	retval =
 	    Rast_get_sample_cubic(fd, window, cats, north, east, usedesc);
 	break;

Modified: grass/trunk/raster/r.proj/main.c
===================================================================
--- grass/trunk/raster/r.proj/main.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.proj/main.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -67,11 +67,11 @@
 /* modify this table to add new methods */
 struct menu menu[] = {
     {p_nearest, "nearest", "nearest neighbor"},
-    {p_bilinear, "linear", "linear interpolation"},
-    {p_cubic, "cubic", "cubic convolution"},
+    {p_bilinear, "bilinear", "bilinear interpolation"},
+    {p_cubic, "bicubic", "bicubic interpolation"},
     {p_lanczos, "lanczos", "lanczos filter"},
-    {p_bilinear_f, "linear_f", "linear interpolation with fallback"},
-    {p_cubic_f, "cubic_f", "cubic convolution with fallback"},
+    {p_bilinear_f, "bilinear_f", "bilinear interpolation with fallback"},
+    {p_cubic_f, "bicubic_f", "bicubic interpolation with fallback"},
     {p_lanczos_f, "lanczos_f", "lanczos filter with fallback"},
     {NULL, NULL, NULL}
 };

Modified: grass/trunk/raster/r.proj/r.proj.html
===================================================================
--- grass/trunk/raster/r.proj/r.proj.html	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.proj/r.proj.html	2014-02-06 18:18:40 UTC (rev 58903)
@@ -87,35 +87,35 @@
 <p><em>r.proj</em> converts a map to a new geographic projection. It
 reads a map from a different location, projects it and write it out to
 the current location. The projected data is resampled with one of four
-different methods: nearest neighbor, linear, cubic convolution or
+different methods: nearest neighbor, bilinear, bicubic iterpolation or
 lanczos.
 <p>The <b>method=nearest</b> method, which performs a nearest neighbor
 assignment, is the fastest of the three resampling methods. It is
 primarily used for categorical data such as a land use classification,
 since it will not change the values of the data
-cells. The <b>method=linear</b> method determines the new value of
+cells. The <b>method=bilinear</b> method determines the new value of
 the cell based on a weighted distance average of the 4 surrounding
-cells in the input map. The <b>method=cubic</b> method determines the
+cells in the input map. The <b>method=bicubic</b> method determines the
 new value of the cell based on a weighted distance average of the 16
 surrounding cells in the input map. The <b>method=lanzcos</b> method
 determines the new value of the cell based on a weighted distance
 average of the 25 surrounding cells in the input map. Compared to
-cubic, lanczos puts a higher weight on cells close to the center and a
+bicubic, lanczos puts a higher weight on cells close to the center and a
 lower weight on cells away from the center, resulting in slightly
 better contrast.
-<p>The linear, cubic and lanczos interpolation methods are most
+<p>The bilinear, bicubic and lanczos interpolation methods are most
 appropriate for continuous data and cause some smoothing. The amount
-of smoothing decreases from linear to cubic to lanczos. These
+of smoothing decreases from bilinear to bicubic to lanczos. These
 options should not be used with categorical data, since the cell
 values will be altered.
-<p>In the linear, cubic and lanczos methods, if any of the surrounding
+<p>In the bilinear, bicubic and lanczos methods, if any of the surrounding
 cells used to interpolate the new cell value are null, the resulting
 cell will be null, even if the nearest cell is not null. This will
 cause some thinning along null borders, such as the coasts of land
-areas in a DEM. The linear_f, cubic_f and lanczos_f interpolation
+areas in a DEM. The bilinear_f, bicubic_f and lanczos_f interpolation
 methods can be used if thinning along null edges is not desired.
 These methods "fall back" to simpler interpolation methods
-along null borders.  That is, from lanczos to cubic to linear to
+along null borders.  That is, from lanczos to bicubic to bilinear to
 nearest.
 <p>If nearest neighbor assignment is used, the output map has the same
 raster format as the input map. If any of the interpolations is used,
@@ -266,7 +266,7 @@
 # Now reproject the raster into the target location
 
 r.proj input=elevation.dem output=elevation.dem.reproj \
-location=source_location_name mapset=PERMANENT res=5 method=cubic
+location=source_location_name mapset=PERMANENT res=5 method=bicubic
 </pre></div>
 
 

Modified: grass/trunk/raster/r.resamp.bspline/main.c
===================================================================
--- grass/trunk/raster/r.resamp.bspline/main.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.resamp.bspline/main.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -82,7 +82,7 @@
     G_add_keyword(_("resample"));
     G_add_keyword(_("interpolation"));
     module->description =
-	_("Performs cubic or linear spline interpolation with Tykhonov regularization.");
+	_("Performs bilinear or bicubic spline interpolation with Tykhonov regularization.");
 
     in_opt = G_define_standard_option(G_OPT_R_INPUT);
 
@@ -117,13 +117,13 @@
 
     method_opt = G_define_standard_option(G_OPT_R_INTERP_TYPE);
     method_opt->description = _("Spline interpolation algorithm");
-    method_opt->options = "linear,cubic";
-    method_opt->answer = "cubic";
+    method_opt->options = "bilinear,bicubic";
+    method_opt->answer = "bicubic";
     method_opt->guisection = _("Settings");
     G_asprintf((char **) &(method_opt->descriptions),
-	       "linear;%s;cubic;%s",
-	       _("Linear interpolation"),
-	       _("Cubic interpolation"));
+	       "bilinear;%s;bicubic;%s",
+	       _("Bilinear interpolation"),
+	       _("Bicubic interpolation"));
 
     lambda_f_opt = G_define_option();
     lambda_f_opt->key = "lambda";

Modified: grass/trunk/raster/r.resamp.bspline/r.resamp.bspline.html
===================================================================
--- grass/trunk/raster/r.resamp.bspline/r.resamp.bspline.html	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.resamp.bspline/r.resamp.bspline.html	2014-02-06 18:18:40 UTC (rev 58903)
@@ -1,5 +1,5 @@
 <h2>DESCRIPTION</h2>
-<em>r.resamp.bspline</em> performs a linear/cubic spline interpolation with
+<em>r.resamp.bspline</em> performs a bilinear/bicubic spline interpolation with
 Tykhonov regularization. The input is a raster surface map, e.g. elevation,
 temperature, precipitation etc. Output is a raster map. Optionally, only
 input NULL cells are interpolated, useful to fill NULL cells, an alternative

Modified: grass/trunk/raster/r.resamp.interp/main.c
===================================================================
--- grass/trunk/raster/r.resamp.interp/main.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.resamp.interp/main.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -82,17 +82,17 @@
     rastout = G_define_standard_option(G_OPT_R_OUTPUT);
 
     method = G_define_standard_option(G_OPT_R_INTERP_TYPE);
-    method->options = "nearest,linear,cubic,lanczos";
-    method->answer = "linear";
+    method->options = "nearest,bilinear,bicubic,lanczos";
+    method->answer = "bilinear";
 
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     if (G_strcasecmp(method->answer, "nearest") == 0)
 	neighbors = 1;
-    else if (G_strcasecmp(method->answer, "linear") == 0)
+    else if (G_strcasecmp(method->answer, "bilinear") == 0)
 	neighbors = 2;
-    else if (G_strcasecmp(method->answer, "cubic") == 0)
+    else if (G_strcasecmp(method->answer, "bicubic") == 0)
 	neighbors = 4;
     else if (G_strcasecmp(method->answer, "lanczos") == 0)
 	neighbors = 5;

Modified: grass/trunk/raster/r.resamp.interp/r.resamp.interp.html
===================================================================
--- grass/trunk/raster/r.resamp.interp/r.resamp.interp.html	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.resamp.interp/r.resamp.interp.html	2014-02-06 18:18:40 UTC (rev 58903)
@@ -9,8 +9,8 @@
 cell in the output map as follows:
 <ul>
 <li>nearest neighbour (1 cell)</li>
-<li>linear (4 cells, also called bilinear)</li>
-<li>cubic (16 cells, also called bicubic)</li>
+<li>bilinear (4 cells)</li>
+<li>bicubic (16 cells)</li>
 <li>lanczos (25 cells)</li>
 </ul>
 
@@ -26,7 +26,7 @@
 r.resamp.rst</em>) resample the map to match the current region settings.
 
  
-<p>Note that for linear, cubic and lanczos interpolation,
+<p>Note that for bilinear, bicubic and lanczos interpolation,
 cells of the output raster that cannot be bounded by the appropriate number
 of input cell centers are set to NULL (NULL propagation). This could occur
 due to the input cells being outside the current region, being NULL or MASKed.

Modified: grass/trunk/raster/r.shaded.relief/r.shaded.relief.html
===================================================================
--- grass/trunk/raster/r.shaded.relief/r.shaded.relief.html	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.shaded.relief/r.shaded.relief.html	2014-02-06 18:18:40 UTC (rev 58903)
@@ -43,7 +43,7 @@
 <h2>NOTES</h2>
 
 To visually improve the result of shade maps from low resolution elevation
-models, use <em>r.resamp.interp</em> with linear or cubic method to
+models, use <em>r.resamp.interp</em> with bilinear or bicubic method to
 resample the DEM at higher resolution. <em>r.shaded.relief</em> is then
 run on the resampled DEM.
 

Modified: grass/trunk/raster/r.viewshed/r.viewshed.html
===================================================================
--- grass/trunk/raster/r.viewshed/r.viewshed.html	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/raster/r.viewshed/r.viewshed.html	2014-02-06 18:18:40 UTC (rev 58903)
@@ -118,7 +118,7 @@
 Two points are visible to each other if their line-of-sight does not
 intersect the terrain. The height for an arbitrary point x in the terrain 
 is interpolated from the 4 surrounding neighbours. This means that this 
-model does a linear (bilinear) interpolation of heights.
+model does a bilinear interpolation of heights.
 
 This model is suitable for both low and high resolution rasters as well 
 as terrain with flat and steep slopes.

Modified: grass/trunk/vector/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/v.surf.bspline/main.c	2014-02-06 16:54:24 UTC (rev 58902)
+++ grass/trunk/vector/v.surf.bspline/main.c	2014-02-06 18:18:40 UTC (rev 58903)
@@ -156,9 +156,9 @@
     type_opt->answer = "linear";
     type_opt->guisection = _("Settings");
     G_asprintf((char **) &(type_opt->descriptions),
-	       "linear;%s;cubic;%s",
-	       _("Linear interpolation"),
-	       _("Cubic interpolation"));
+	       "bilinear;%s;bicubic;%s",
+	       _("Bilinear interpolation"),
+	       _("Bicubic interpolation"));
 
     lambda_f_opt = G_define_option();
     lambda_f_opt->key = "lambda_i";



More information about the grass-commit mailing list