Kaynağa Gözat

rasterlib: rename interpolation methods again to use correct names (linear->bilinear, cubic->bicubic)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58903 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 yıl önce
ebeveyn
işleme
d933668e88

+ 2 - 2
include/raster.h

@@ -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;

+ 4 - 4
lib/gis/parser_standard_options.c

@@ -315,12 +315,12 @@ struct Option *G_define_standard_option(int opt)
         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 */

+ 4 - 4
lib/raster/interp.c

@@ -199,11 +199,11 @@ int Rast_option_to_interp_type(const struct Option *option)
         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;
         }
     }
 

+ 2 - 2
lib/raster/sample.c

@@ -58,11 +58,11 @@ DCELL Rast_get_sample(int fd,
 	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;

+ 4 - 4
raster/r.proj/main.c

@@ -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}
 };

+ 10 - 10
raster/r.proj/r.proj.html

@@ -87,35 +87,35 @@ for accomplishing this, therefore, is as follows:
 <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 &quot;fall back&quot; 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 @@ g.region vect=bounds_reprojected res=5 -a
 # 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>
 
 

+ 6 - 6
raster/r.resamp.bspline/main.c

@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
     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 @@ int main(int argc, char *argv[])
 
     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";

+ 1 - 1
raster/r.resamp.bspline/r.resamp.bspline.html

@@ -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

+ 4 - 4
raster/r.resamp.interp/main.c

@@ -82,17 +82,17 @@ int main(int argc, char *argv[])
     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;

+ 3 - 3
raster/r.resamp.interp/r.resamp.interp.html

@@ -9,8 +9,8 @@ number of adjacent cells in the input map to determine the value of each
 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 @@ to a different resolution rather than for interpolation from scattered data
 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.

+ 1 - 1
raster/r.shaded.relief/r.shaded.relief.html

@@ -43,7 +43,7 @@ shaded relief map.
 <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.
 

+ 1 - 1
raster/r.viewshed/r.viewshed.html

@@ -118,7 +118,7 @@ center, is interpolated. Thus the terrain is viewed as a smooth surface.
 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.

+ 3 - 3
vector/v.surf.bspline/main.c

@@ -156,9 +156,9 @@ int main(int argc, char *argv[])
     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";