瀏覽代碼

rasterlib: fns from raster.c renamed, see
http://trac.osgeo.org/grass/wiki/Grass7/RasterLib


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38128 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父節點
當前提交
d71a5ec6ab

+ 7 - 7
imagery/i.pca/main.c

@@ -264,7 +264,7 @@ static int calc_mu(int *fds, double *mu, int bands)
 		    continue;
 		}
 
-		sum += Rast_get_raster_value_d(rowbuf, maptype);
+		sum += Rast_get_d_value(rowbuf, maptype);
 		ptr = G_incr_void_ptr(ptr, Rast_cell_size(maptype));
 	    }
 	}
@@ -333,8 +333,8 @@ static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 		    }
 
 		    covar[j][k] +=
-			((double)Rast_get_raster_value_d(ptr1, maptype) -
-			 mu[j]) * ((double)Rast_get_raster_value_d(ptr2,
+			((double)Rast_get_d_value(ptr1, maptype) -
+			 mu[j]) * ((double)Rast_get_d_value(ptr2,
 						   maptype2) - mu[k]);
 
 		    ptr1 = G_incr_void_ptr(ptr1, Rast_cell_size(maptype));
@@ -461,7 +461,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 
 			/* corresp. cell of j-th band */
 			d_buf[col] +=
-			    eigmat[i][j] * Rast_get_raster_value_d(rowptr,
+			    eigmat[i][j] * Rast_get_d_value(rowptr,
 								maptype);
 
 			/* the cell entry is complete */
@@ -479,7 +479,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 			    else if (scale) {
 
 				if (min == max) {
-				    Rast_set_raster_value_c(outptr, 1,
+				    Rast_set_c_value(outptr, 1,
 							 CELL_TYPE);
 				}
 				else {
@@ -490,13 +490,13 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 						  min) / old_range) +
 						scale_min);
 
-				    Rast_set_raster_value_c(outptr, tmpcell,
+				    Rast_set_c_value(outptr, tmpcell,
 							 CELL_TYPE);
 				}
 			    }
 			    else {	/* (!scale) */
 
-				Rast_set_raster_value_d(outptr, d_buf[col],
+				Rast_set_d_value(outptr, d_buf[col],
 						     DCELL_TYPE);
 			    }
 			}

+ 6 - 6
include/raster.h

@@ -471,12 +471,12 @@ void Rast_get_fp_range_min_max(const struct FPRange *, DCELL *, DCELL *);
 /* raster.c */
 int Rast_raster_cmp(const void *, const void *, RASTER_MAP_TYPE);
 void Rast_raster_cpy(void *, const void *, int, RASTER_MAP_TYPE);
-void Rast_set_raster_value_c(void *, CELL, RASTER_MAP_TYPE);
-void Rast_set_raster_value_f(void *, FCELL, RASTER_MAP_TYPE);
-void Rast_set_raster_value_d(void *, DCELL, RASTER_MAP_TYPE);
-CELL Rast_get_raster_value_c(const void *, RASTER_MAP_TYPE);
-FCELL Rast_get_raster_value_f(const void *, RASTER_MAP_TYPE);
-DCELL Rast_get_raster_value_d(const void *, RASTER_MAP_TYPE);
+void Rast_set_c_value(void *, CELL, RASTER_MAP_TYPE);
+void Rast_set_f_value(void *, FCELL, RASTER_MAP_TYPE);
+void Rast_set_d_value(void *, DCELL, RASTER_MAP_TYPE);
+CELL Rast_get_c_value(const void *, RASTER_MAP_TYPE);
+FCELL Rast_get_f_value(const void *, RASTER_MAP_TYPE);
+DCELL Rast_get_d_value(const void *, RASTER_MAP_TYPE);
 
 /* raster_metadata.c */
 int Rast_read_raster_units(const char *, const char *, char *);

+ 12 - 12
lib/raster/cats.c

@@ -406,7 +406,7 @@ char *Rast_get_cat(void *rast,
 
     /* first search the list of labels */
     *label = 0;
-    val = Rast_get_raster_value_d(rast, data_type);
+    val = Rast_get_d_value(rast, data_type);
     i = Rast_quant_get_cell_value(&pcats->q, val);
 
     G_debug(5, "Rast_get_cat(): val %lf found i %d", val, i);
@@ -560,7 +560,7 @@ int Rast_mark_cats(const void *rast_row,
 
     while (ncols-- > 0) {
 	i = Rast_quant_get_cell_value(&pcats->q,
-				   Rast_get_raster_value_d(rast_row, data_type));
+				   Rast_get_d_value(rast_row, data_type));
 	if (Rast_is_c_null_value(&i))
 	    continue;
 	if (i > pcats->ncats)
@@ -678,8 +678,8 @@ char *Rast_get_next_marked_cat(struct Categories *pcats,
     char *lab;
 
     lab = Rast_get_next_marked_d_cat(pcats, &val1, &val2, count);
-    Rast_set_raster_value_d(rast1, val1, data_type);
-    Rast_set_raster_value_d(rast2, val2, data_type);
+    Rast_set_d_value(rast1, val1, data_type);
+    Rast_set_d_value(rast2, val2, data_type);
     return lab;
 }
 
@@ -913,8 +913,8 @@ int Rast_set_cat(const void *rast1, const void *rast2,
 {
     DCELL val1, val2;
 
-    val1 = Rast_get_raster_value_d(rast1, data_type);
-    val2 = Rast_get_raster_value_d(rast2, data_type);
+    val1 = Rast_get_d_value(rast1, data_type);
+    val2 = Rast_get_d_value(rast2, data_type);
     return Rast_set_d_cat(&val1, &val2, label, pcats);
 }
 
@@ -1059,8 +1059,8 @@ char *Rast_get_ith_f_cat(const struct Categories *pcats,
     DCELL val1, val2;
 
     tmp = Rast_get_ith_d_cat(pcats, i, &val1, &val2);
-    Rast_set_raster_value_d(rast1, val1, data_type);
-    Rast_set_raster_value_d(rast2, val2, data_type);
+    Rast_set_d_value(rast1, val1, data_type);
+    Rast_set_d_value(rast2, val2, data_type);
     return tmp;
 }
 
@@ -1086,8 +1086,8 @@ char *Rast_get_ith_c_cat(const struct Categories *pcats,
     DCELL val1, val2;
 
     tmp = Rast_get_ith_d_cat(pcats, i, &val1, &val2);
-    Rast_set_raster_value_d(rast1, val1, data_type);
-    Rast_set_raster_value_d(rast2, val2, data_type);
+    Rast_set_d_value(rast1, val1, data_type);
+    Rast_set_d_value(rast2, val2, data_type);
     return tmp;
 }
 
@@ -1113,8 +1113,8 @@ char *Rast_get_ith_cat(const struct Categories *pcats, int i, void *rast1,
     DCELL val1, val2;
 
     tmp = Rast_get_ith_d_cat(pcats, i, &val1, &val2);
-    Rast_set_raster_value_d(rast1, val1, data_type);
-    Rast_set_raster_value_d(rast2, val2, data_type);
+    Rast_set_d_value(rast1, val1, data_type);
+    Rast_set_d_value(rast2, val2, data_type);
     return tmp;
 }
 

+ 1 - 1
lib/raster/color_look.c

@@ -256,7 +256,7 @@ void Rast__lookup_colors(const void *raster, unsigned char *red,
 	    last_ptr = ptr;
 	    continue;
 	}
-	val = Rast_get_raster_value_d(ptr, data_type);
+	val = Rast_get_d_value(ptr, data_type);
 	/* DEBUG fprintf (stderr, "val: %.4lf\n", val); */
 	last_ptr = ptr;
 

+ 2 - 2
lib/raster/color_rule.c

@@ -250,8 +250,8 @@ static void add_color_rule(const void *pt1, int r1, int g1, int b1,
     DCELL min, max, val1, val2;
     CELL cat;
 
-    val1 = Rast_get_raster_value_d(pt1, data_type);
-    val2 = Rast_get_raster_value_d(pt2, data_type);
+    val1 = Rast_get_d_value(pt1, data_type);
+    val2 = Rast_get_d_value(pt2, data_type);
     /* allocate a low:high rule */
     rule = (struct _Color_Rule_ *)G_malloc(sizeof(*rule));
     rule->next = rule->prev = NULL;

+ 1 - 1
lib/raster/get_row.c

@@ -675,7 +675,7 @@ static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
 	return 1;
 
     for (i = 0; i < R__.window.cols; i++) {
-	Rast_set_raster_value_c(rast, temp_buf[i], data_type);
+	Rast_set_c_value(rast, temp_buf[i], data_type);
 	rast = G_incr_void_ptr(rast, size);
     }
 

+ 1 - 1
lib/raster/put_row.c

@@ -561,7 +561,7 @@ static int put_data_gdal(int fd, const void *rast, int row, int n,
 
     for (i = 0; i < n; i++) {
 	if (Rast_is_null_value(src, map_type) || zeros_r_nulls && !*(CELL *)src)
-	    Rast_set_raster_value_d(dst, null_val, map_type);
+	    Rast_set_d_value(dst, null_val, map_type);
 	else
 	    memcpy(dst, src, size);
 	src = G_incr_void_ptr(src, size);

+ 6 - 6
lib/raster/raster.c

@@ -88,7 +88,7 @@ void Rast_raster_cpy(void *v1, const void *v2, int n, RASTER_MAP_TYPE data_type)
  * \param cval value to set
  * \param data_type raster type (CELL, FCELL, DCELL)
  */
-void Rast_set_raster_value_c(void *rast, CELL cval, RASTER_MAP_TYPE data_type)
+void Rast_set_c_value(void *rast, CELL cval, RASTER_MAP_TYPE data_type)
 {
     CELL c;
 
@@ -121,7 +121,7 @@ void Rast_set_raster_value_c(void *rast, CELL cval, RASTER_MAP_TYPE data_type)
  * \param fval value to set
  * \param data_type raster type (CELL, FCELL, DCELL)
  */
-void Rast_set_raster_value_f(void *rast, FCELL fval, RASTER_MAP_TYPE data_type)
+void Rast_set_f_value(void *rast, FCELL fval, RASTER_MAP_TYPE data_type)
 {
     FCELL f;
 
@@ -155,7 +155,7 @@ void Rast_set_raster_value_f(void *rast, FCELL fval, RASTER_MAP_TYPE data_type)
  * \param fval value to set
  * \param data_type raster type (CELL, FCELL, DCELL)
  */
-void Rast_set_raster_value_d(void *rast, DCELL dval, RASTER_MAP_TYPE data_type)
+void Rast_set_d_value(void *rast, DCELL dval, RASTER_MAP_TYPE data_type)
 {
     DCELL d;
 
@@ -194,7 +194,7 @@ void Rast_set_raster_value_d(void *rast, DCELL dval, RASTER_MAP_TYPE data_type)
  *
  * \return raster value
  */
-CELL Rast_get_raster_value_c(const void *rast, RASTER_MAP_TYPE data_type)
+CELL Rast_get_c_value(const void *rast, RASTER_MAP_TYPE data_type)
 {
     CELL c;
 
@@ -228,7 +228,7 @@ CELL Rast_get_raster_value_c(const void *rast, RASTER_MAP_TYPE data_type)
  *
  * \return raster value
  */
-FCELL Rast_get_raster_value_f(const void *rast, RASTER_MAP_TYPE data_type)
+FCELL Rast_get_f_value(const void *rast, RASTER_MAP_TYPE data_type)
 {
     FCELL f;
 
@@ -263,7 +263,7 @@ FCELL Rast_get_raster_value_f(const void *rast, RASTER_MAP_TYPE data_type)
  *
  * \return raster value
  */
-DCELL Rast_get_raster_value_d(const void *rast, RASTER_MAP_TYPE data_type)
+DCELL Rast_get_d_value(const void *rast, RASTER_MAP_TYPE data_type)
 {
     DCELL d;
 

+ 1 - 1
raster/r.cost/main.c

@@ -659,7 +659,7 @@ int main(int argc, char *argv[])
 		    double cellval;
 
 		    if (start_with_raster_vals == 1) {
-			cellval = Rast_get_raster_value_d(ptr2, data_type2);
+			cellval = Rast_get_d_value(ptr2, data_type2);
 			new_cell = insert(cellval, row, col);
 			segment_put(&out_seg, &cellval, row, col);
 		    }

+ 1 - 1
raster/r.in.ascii/main.c

@@ -219,7 +219,7 @@ int main(int argc, char *argv[])
 		    Rast_set_null_value(rast_ptr, 1, data_type);
 		}
 		else {
-		    Rast_set_raster_value_d(rast_ptr,
+		    Rast_set_d_value(rast_ptr,
 					 (DCELL) (x * mult), data_type);
 		}
 	    }

+ 3 - 3
raster/r.in.mat/main.c

@@ -434,17 +434,17 @@ int main(int argc, char *argv[])
 		switch (map_type) {
 		case CELL_TYPE:
 		    pval_i = (int *)array_ptr;
-		    Rast_set_raster_value_c(rastline_ptr, (CELL) pval_i[0],
+		    Rast_set_c_value(rastline_ptr, (CELL) pval_i[0],
 					 map_type);
 		    break;
 		case FCELL_TYPE:
 		    pval_f = (float *)array_ptr;
-		    Rast_set_raster_value_f(rastline_ptr, (FCELL) pval_f[0],
+		    Rast_set_f_value(rastline_ptr, (FCELL) pval_f[0],
 					 map_type);
 		    break;
 		case DCELL_TYPE:
 		    pval_d = (double *)array_ptr;
-		    Rast_set_raster_value_d(rastline_ptr, (DCELL) pval_d[0],
+		    Rast_set_d_value(rastline_ptr, (DCELL) pval_d[0],
 					 map_type);
 		    break;
 		default:

+ 25 - 25
raster/r.in.xyz/main.c

@@ -699,14 +699,14 @@ int main(int argc, char *argv[])
 		    head_id = new_node();
 		    nodes[head_id].next = -1;
 		    nodes[head_id].z = z;
-		    Rast_set_raster_value_c(ptr, head_id, CELL_TYPE);	/* store index to head */
+		    Rast_set_c_value(ptr, head_id, CELL_TYPE);	/* store index to head */
 		}
 		else {		/* head is already there */
 
-		    head_id = Rast_get_raster_value_c(ptr, CELL_TYPE);	/* get index to head */
+		    head_id = Rast_get_c_value(ptr, CELL_TYPE);	/* get index to head */
 		    head_id = add_node(head_id, z);
 		    if (head_id != -1)
-			Rast_set_raster_value_c(ptr, head_id, CELL_TYPE);	/* store index to head */
+			Rast_set_c_value(ptr, head_id, CELL_TYPE);	/* store index to head */
 		}
 	    }
 	}			/* while !EOF */
@@ -750,9 +750,9 @@ int main(int argc, char *argv[])
 		ptr = raster_row;
 		for (col = 0; col < cols; col++) {
 		    offset = (row * cols + col) * Rast_cell_size(rtype);
-		    min = Rast_get_raster_value_d(min_array + offset, rtype);
-		    max = Rast_get_raster_value_d(max_array + offset, rtype);
-		    Rast_set_raster_value_d(ptr, max - min, rtype);
+		    min = Rast_get_d_value(min_array + offset, rtype);
+		    max = Rast_get_d_value(max_array + offset, rtype);
+		    Rast_set_d_value(ptr, max - min, rtype);
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
 		}
 		break;
@@ -762,13 +762,13 @@ int main(int argc, char *argv[])
 		for (col = 0; col < cols; col++) {
 		    offset = (row * cols + col) * Rast_cell_size(rtype);
 		    n_offset = (row * cols + col) * Rast_cell_size(CELL_TYPE);
-		    n = Rast_get_raster_value_c(n_array + n_offset, CELL_TYPE);
-		    sum = Rast_get_raster_value_d(sum_array + offset, rtype);
+		    n = Rast_get_c_value(n_array + n_offset, CELL_TYPE);
+		    sum = Rast_get_d_value(sum_array + offset, rtype);
 
 		    if (n == 0)
 			Rast_set_null_value(ptr, 1, rtype);
 		    else
-			Rast_set_raster_value_d(ptr, (sum / n), rtype);
+			Rast_set_d_value(ptr, (sum / n), rtype);
 
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
 		}
@@ -781,9 +781,9 @@ int main(int argc, char *argv[])
 		for (col = 0; col < cols; col++) {
 		    offset = (row * cols + col) * Rast_cell_size(rtype);
 		    n_offset = (row * cols + col) * Rast_cell_size(CELL_TYPE);
-		    n = Rast_get_raster_value_c(n_array + n_offset, CELL_TYPE);
-		    sum = Rast_get_raster_value_d(sum_array + offset, rtype);
-		    sumsq = Rast_get_raster_value_d(sumsq_array + offset, rtype);
+		    n = Rast_get_c_value(n_array + n_offset, CELL_TYPE);
+		    sum = Rast_get_d_value(sum_array + offset, rtype);
+		    sumsq = Rast_get_d_value(sumsq_array + offset, rtype);
 
 		    if (n == 0)
 			Rast_set_null_value(ptr, 1, rtype);
@@ -793,13 +793,13 @@ int main(int argc, char *argv[])
 			    variance = 0.0;
 
 			if (method == METHOD_STDDEV)
-			    Rast_set_raster_value_d(ptr, sqrt(variance), rtype);
+			    Rast_set_d_value(ptr, sqrt(variance), rtype);
 
 			else if (method == METHOD_VARIANCE)
-			    Rast_set_raster_value_d(ptr, variance, rtype);
+			    Rast_set_d_value(ptr, variance, rtype);
 
 			else if (method == METHOD_COEFF_VAR)
-			    Rast_set_raster_value_d(ptr,
+			    Rast_set_d_value(ptr,
 						 100 * sqrt(variance) / (sum /
 									 n),
 						 rtype);
@@ -817,7 +817,7 @@ int main(int argc, char *argv[])
 		    else {	/* one or more points in cell */
 
 			head_id =
-			    Rast_get_raster_value_c(index_array + n_offset,
+			    Rast_get_c_value(index_array + n_offset,
 						 CELL_TYPE);
 			node_id = head_id;
 
@@ -829,7 +829,7 @@ int main(int argc, char *argv[])
 			}
 
 			if (n == 1)	/* only one point, use that */
-			    Rast_set_raster_value_d(ptr, nodes[head_id].z,
+			    Rast_set_d_value(ptr, nodes[head_id].z,
 						 rtype);
 			else if (n % 2 != 0) {	/* odd number of points: median_i = (n + 1) / 2 */
 			    n = (n + 1) / 2;
@@ -837,7 +837,7 @@ int main(int argc, char *argv[])
 			    for (j = 1; j < n; j++)	/* get "median element" */
 				node_id = nodes[node_id].next;
 
-			    Rast_set_raster_value_d(ptr, nodes[node_id].z,
+			    Rast_set_d_value(ptr, nodes[node_id].z,
 						 rtype);
 			}
 			else {	/* even number of points: median = (val_below + val_above) / 2 */
@@ -850,7 +850,7 @@ int main(int argc, char *argv[])
 
 			    z = (nodes[node_id].z +
 				 nodes[nodes[node_id].next].z) / 2;
-			    Rast_set_raster_value_d(ptr, z, rtype);
+			    Rast_set_d_value(ptr, z, rtype);
 			}
 		    }
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
@@ -864,7 +864,7 @@ int main(int argc, char *argv[])
 			Rast_set_null_value(ptr, 1, rtype);
 		    else {
 			head_id =
-			    Rast_get_raster_value_c(index_array + n_offset,
+			    Rast_get_c_value(index_array + n_offset,
 						 CELL_TYPE);
 			node_id = head_id;
 			n = 0;
@@ -895,7 +895,7 @@ int main(int argc, char *argv[])
 			    node_id = nodes[node_id].next;
 
 			z = (z + nodes[node_id].z) / 2;
-			Rast_set_raster_value_d(ptr, z, rtype);
+			Rast_set_d_value(ptr, z, rtype);
 		    }
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
 		}
@@ -908,7 +908,7 @@ int main(int argc, char *argv[])
 			Rast_set_null_value(ptr, 1, rtype);
 		    else {
 			head_id =
-			    Rast_get_raster_value_c(index_array + n_offset,
+			    Rast_get_c_value(index_array + n_offset,
 						 CELL_TYPE);
 			node_id = head_id;
 
@@ -943,7 +943,7 @@ int main(int argc, char *argv[])
 				    sumdev / ((n - 1) *
 					      pow(sqrt(variance), 3));
 			}
-			Rast_set_raster_value_d(ptr, skew, rtype);
+			Rast_set_d_value(ptr, skew, rtype);
 		    }
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
 		}
@@ -956,7 +956,7 @@ int main(int argc, char *argv[])
 			Rast_set_null_value(ptr, 1, rtype);
 		    else {
 			head_id =
-			    Rast_get_raster_value_c(index_array + n_offset,
+			    Rast_get_c_value(index_array + n_offset,
 						 CELL_TYPE);
 
 			node_id = head_id;
@@ -1000,7 +1000,7 @@ int main(int argc, char *argv[])
 			    }
 			    mean = sum / n;
 			}
-			Rast_set_raster_value_d(ptr, mean, rtype);
+			Rast_set_d_value(ptr, mean, rtype);
 		    }
 		    ptr = G_incr_void_ptr(ptr, Rast_cell_size(rtype));
 		}

+ 13 - 13
raster/r.in.xyz/support.c

@@ -37,7 +37,7 @@ int blank_array(void *array, int nrows, int ncols, RASTER_MAP_TYPE map_type,
 
 	for (row = 0; row < nrows; row++) {
 	    for (col = 0; col < ncols; col++) {
-		Rast_set_raster_value_c(ptr, 0, map_type);
+		Rast_set_c_value(ptr, 0, map_type);
 		ptr = G_incr_void_ptr(ptr, Rast_cell_size(map_type));
 	    }
 	}
@@ -62,8 +62,8 @@ int update_n(void *array, int cols, int row, int col)
     void *ptr = get_cell_ptr(array, cols, row, col, CELL_TYPE);
     CELL old_n;
 
-    old_n = Rast_get_raster_value_c(ptr, CELL_TYPE);
-    Rast_set_raster_value_c(ptr, (1 + old_n), CELL_TYPE);
+    old_n = Rast_get_c_value(ptr, CELL_TYPE);
+    Rast_set_c_value(ptr, (1 + old_n), CELL_TYPE);
 
     return 0;
 }
@@ -76,11 +76,11 @@ int update_min(void *array, int cols, int row, int col,
     DCELL old_val;
 
     if (Rast_is_null_value(ptr, map_type))
-	Rast_set_raster_value_d(ptr, (DCELL) value, map_type);
+	Rast_set_d_value(ptr, (DCELL) value, map_type);
     else {
-	old_val = Rast_get_raster_value_d(ptr, map_type);
+	old_val = Rast_get_d_value(ptr, map_type);
 	if (value < old_val)
-	    Rast_set_raster_value_d(ptr, (DCELL) value, map_type);
+	    Rast_set_d_value(ptr, (DCELL) value, map_type);
     }
     return 0;
 }
@@ -93,11 +93,11 @@ int update_max(void *array, int cols, int row, int col,
     DCELL old_val;
 
     if (Rast_is_null_value(ptr, map_type))
-	Rast_set_raster_value_d(ptr, (DCELL) value, map_type);
+	Rast_set_d_value(ptr, (DCELL) value, map_type);
     else {
-	old_val = Rast_get_raster_value_d(ptr, map_type);
+	old_val = Rast_get_d_value(ptr, map_type);
 	if (value > old_val)
-	    Rast_set_raster_value_d(ptr, (DCELL) value, map_type);
+	    Rast_set_d_value(ptr, (DCELL) value, map_type);
     }
 
     return 0;
@@ -110,8 +110,8 @@ int update_sum(void *array, int cols, int row, int col,
     void *ptr = get_cell_ptr(array, cols, row, col, map_type);
     DCELL old_val;
 
-    old_val = Rast_get_raster_value_d(ptr, map_type);
-    Rast_set_raster_value_d(ptr, value + old_val, map_type);
+    old_val = Rast_get_d_value(ptr, map_type);
+    Rast_set_d_value(ptr, value + old_val, map_type);
 
     return 0;
 }
@@ -123,8 +123,8 @@ int update_sumsq(void *array, int cols, int row, int col,
     void *ptr = get_cell_ptr(array, cols, row, col, map_type);
     DCELL old_val;
 
-    old_val = Rast_get_raster_value_d(ptr, map_type);
-    Rast_set_raster_value_d(ptr, (value * value) + old_val, map_type);
+    old_val = Rast_get_d_value(ptr, map_type);
+    Rast_set_d_value(ptr, (value * value) + old_val, map_type);
 
     return 0;
 }

+ 2 - 2
raster/r.null/mask.c

@@ -30,9 +30,9 @@ int mask_raster_array(void *rast, int ncols,
     DCELL x;
 
     while (ncols-- > 0) {
-	x = Rast_get_raster_value_d(rast, data_type);
+	x = Rast_get_d_value(rast, data_type);
 	if (change_null && Rast_is_null_value(rast, data_type))
-	    Rast_set_raster_value_d(rast, new_null, data_type);
+	    Rast_set_d_value(rast, new_null, data_type);
 	if (mask_d_select(&x, &d_mask))
 	    Rast_set_null_value(rast, 1, data_type);
 	rast = G_incr_void_ptr(rast, Rast_cell_size(data_type));

+ 1 - 1
raster/r.patch/do_patch.c

@@ -15,7 +15,7 @@ int G_is_zero_value(void *rast, RASTER_MAP_TYPE data_type)
     /* insert 0 check here */
 
     return Rast_is_null_value(rast, data_type) ||
-	Rast_get_raster_value_d(rast, data_type) != 0.0 ? 0 : 1;
+	Rast_get_d_value(rast, data_type) != 0.0 ? 0 : 1;
 }
 
 

+ 1 - 1
raster/r.proj/bilinear.c

@@ -64,5 +64,5 @@ void p_bilinear(struct cache *ibuffer,	/* input buffer                  */
 
     result = Rast_interp_bilinear(t, u, *c00, *c01, *c10, *c11);
 
-    Rast_set_raster_value_f(obufptr, result, cell_type);
+    Rast_set_f_value(obufptr, result, cell_type);
 }

+ 1 - 1
raster/r.proj/bilinear_f.c

@@ -44,5 +44,5 @@ void p_bilinear_f(struct cache *ibuffer,	/* input buffer                  */
     p_bilinear(ibuffer, obufptr, cell_type, col_idx, row_idx, cellhd);
     /* fallback to nearest if bilinear is null */
     if (Rast_is_f_null_value(obufptr))
-        Rast_set_raster_value_f(obufptr, *cellp, cell_type);
+        Rast_set_f_value(obufptr, *cellp, cell_type);
 }

+ 1 - 1
raster/r.proj/cubic.c

@@ -70,5 +70,5 @@ void p_cubic(struct cache *ibuffer,	/* input buffer                  */
 
     result = Rast_interp_cubic(u, val[0], val[1], val[2], val[3]);
 
-    Rast_set_raster_value_f(obufptr, result, cell_type);
+    Rast_set_f_value(obufptr, result, cell_type);
 }

+ 1 - 1
raster/r.proj/cubic_f.c

@@ -48,6 +48,6 @@ void p_cubic_f(struct cache *ibuffer,	/* input buffer                  */
         p_bilinear(ibuffer, obufptr, cell_type, col_idx, row_idx, cellhd);
         /* fallback to nearest if bilinear is null */
 		if (Rast_is_f_null_value(obufptr))
-            Rast_set_raster_value_f(obufptr, *cellp, cell_type);
+            Rast_set_f_value(obufptr, *cellp, cell_type);
     }
 }

+ 1 - 1
raster/r.proj/nearest.c

@@ -37,5 +37,5 @@ void p_nearest(struct cache *ibuffer,	/* input buffer                  */
 	return;
     }
 
-    Rast_set_raster_value_f(obufptr, *cellp, cell_type);
+    Rast_set_f_value(obufptr, *cellp, cell_type);
 }

+ 10 - 10
raster/r.slope.aspect/main.c

@@ -811,10 +811,10 @@ int main(int argc, char *argv[])
 		    *((CELL *) slp_ptr) = (CELL) test;
 		else {
 		    if (deg)
-			Rast_set_raster_value_d(slp_ptr,
+			Rast_set_d_value(slp_ptr,
 					     (DCELL) slp_in_deg, data_type);
 		    else
-			Rast_set_raster_value_d(slp_ptr,
+			Rast_set_d_value(slp_ptr,
 					     (DCELL) slp_in_perc, data_type);
 		}
 		slp_ptr = G_incr_void_ptr(slp_ptr, Rast_cell_size(data_type));
@@ -844,7 +844,7 @@ int main(int argc, char *argv[])
 		    if (out_type == CELL_TYPE)
 			*((CELL *) asp_ptr) = (CELL) (aspect + .5);
 		    else
-			Rast_set_raster_value_d(asp_ptr,
+			Rast_set_d_value(asp_ptr,
 					     (DCELL) aspect, data_type);
 		}
 		else
@@ -862,7 +862,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dx_ptr) = (CELL) (scik1 * dx);
 		else
-		    Rast_set_raster_value_d(dx_ptr, (DCELL) dx, data_type);
+		    Rast_set_d_value(dx_ptr, (DCELL) dx, data_type);
 		dx_ptr = G_incr_void_ptr(dx_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -870,7 +870,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dy_ptr) = (CELL) (scik1 * dy);
 		else
-		    Rast_set_raster_value_d(dy_ptr, (DCELL) dy, data_type);
+		    Rast_set_d_value(dy_ptr, (DCELL) dy, data_type);
 		dy_ptr = G_incr_void_ptr(dy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -892,7 +892,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dxx_ptr) = (CELL) (scik1 * dxx);
 		else
-		    Rast_set_raster_value_d(dxx_ptr, (DCELL) dxx, data_type);
+		    Rast_set_d_value(dxx_ptr, (DCELL) dxx, data_type);
 		dxx_ptr = G_incr_void_ptr(dxx_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -900,7 +900,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dyy_ptr) = (CELL) (scik1 * dyy);
 		else
-		    Rast_set_raster_value_d(dyy_ptr, (DCELL) dyy, data_type);
+		    Rast_set_d_value(dyy_ptr, (DCELL) dyy, data_type);
 		dyy_ptr = G_incr_void_ptr(dyy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -908,7 +908,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dxy_ptr) = (CELL) (scik1 * dxy);
 		else
-		    Rast_set_raster_value_d(dxy_ptr, (DCELL) dxy, data_type);
+		    Rast_set_d_value(dxy_ptr, (DCELL) dxy, data_type);
 		dxy_ptr = G_incr_void_ptr(dxy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -944,7 +944,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) pcurv_ptr) = (CELL) (scik1 * pcurv);
 		else
-		    Rast_set_raster_value_d(pcurv_ptr, (DCELL) pcurv, data_type);
+		    Rast_set_d_value(pcurv_ptr, (DCELL) pcurv, data_type);
 		pcurv_ptr =
 		    G_incr_void_ptr(pcurv_ptr, Rast_cell_size(data_type));
 	    }
@@ -953,7 +953,7 @@ int main(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) tcurv_ptr) = (CELL) (scik1 * tcurv);
 		else
-		    Rast_set_raster_value_d(tcurv_ptr, (DCELL) tcurv, data_type);
+		    Rast_set_d_value(tcurv_ptr, (DCELL) tcurv, data_type);
 		tcurv_ptr =
 		    G_incr_void_ptr(tcurv_ptr, Rast_cell_size(data_type));
 	    }

+ 1 - 1
raster/r.stats/raw_stats.c

@@ -53,7 +53,7 @@ int raw_stats(int fd[], int with_coordinates, int with_xy, int with_labels)
 		nulls_found = 0;
 		for (i = 0; i < nfiles; i++) {
 		    /*
-		       Rast_set_raster_value_d(zero_val, 0.0, map_type[i]);
+		       Rast_set_d_value(zero_val, 0.0, map_type[i]);
 		       if (Rast_raster_cmp(rastp[i], zero_val, map_type[i]) != 0)
 		       break;
 		     */

+ 1 - 1
raster/r.to.vect/areas.c

@@ -100,7 +100,7 @@ static int update_width(struct area_table *, int);
 static int nabors(void);
 
 #define get_raster_value(ptr, col) \
-	Rast_get_raster_value_d(G_incr_void_ptr(ptr, (col)*data_size), data_type)
+	Rast_get_d_value(G_incr_void_ptr(ptr, (col)*data_size), data_type)
 
 /* extract_areas - trace boundaries of polygons in file */
 

+ 1 - 1
raster/r.walk/main.c

@@ -909,7 +909,7 @@ int main(int argc, char *argv[])
 		    double cellval;
 
 		    if (start_with_raster_vals == 1) {
-			cellval = Rast_get_raster_value_d(ptr2, data_type2);
+			cellval = Rast_get_d_value(ptr2, data_type2);
 			new_cell = insert(cellval, row, col);
 			segment_put(&out_seg, &cellval, row, col);
 		    }

+ 10 - 10
swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c

@@ -837,10 +837,10 @@ int r_slope_aspect(int argc, char *argv[])
 		    *((CELL *) slp_ptr) = (CELL) test;
 		else {
 		    if (deg)
-			Rast_set_raster_value_d(slp_ptr,
+			Rast_set_d_value(slp_ptr,
 					     (DCELL) slp_in_deg, data_type);
 		    else
-			Rast_set_raster_value_d(slp_ptr,
+			Rast_set_d_value(slp_ptr,
 					     (DCELL) slp_in_perc, data_type);
 		}
 		slp_ptr = G_incr_void_ptr(slp_ptr, Rast_cell_size(data_type));
@@ -870,7 +870,7 @@ int r_slope_aspect(int argc, char *argv[])
 		    if (out_type == CELL_TYPE)
 			*((CELL *) asp_ptr) = (CELL) (aspect + .5);
 		    else
-			Rast_set_raster_value_d(asp_ptr,
+			Rast_set_d_value(asp_ptr,
 					     (DCELL) aspect, data_type);
 		}
 		else
@@ -888,7 +888,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dx_ptr) = (CELL) (scik1 * dx);
 		else
-		    Rast_set_raster_value_d(dx_ptr, (DCELL) dx, data_type);
+		    Rast_set_d_value(dx_ptr, (DCELL) dx, data_type);
 		dx_ptr = G_incr_void_ptr(dx_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -896,7 +896,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dy_ptr) = (CELL) (scik1 * dy);
 		else
-		    Rast_set_raster_value_d(dy_ptr, (DCELL) dy, data_type);
+		    Rast_set_d_value(dy_ptr, (DCELL) dy, data_type);
 		dy_ptr = G_incr_void_ptr(dy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -918,7 +918,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dxx_ptr) = (CELL) (scik1 * dxx);
 		else
-		    Rast_set_raster_value_d(dxx_ptr, (DCELL) dxx, data_type);
+		    Rast_set_d_value(dxx_ptr, (DCELL) dxx, data_type);
 		dxx_ptr = G_incr_void_ptr(dxx_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -926,7 +926,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dyy_ptr) = (CELL) (scik1 * dyy);
 		else
-		    Rast_set_raster_value_d(dyy_ptr, (DCELL) dyy, data_type);
+		    Rast_set_d_value(dyy_ptr, (DCELL) dyy, data_type);
 		dyy_ptr = G_incr_void_ptr(dyy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -934,7 +934,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) dxy_ptr) = (CELL) (scik1 * dxy);
 		else
-		    Rast_set_raster_value_d(dxy_ptr, (DCELL) dxy, data_type);
+		    Rast_set_d_value(dxy_ptr, (DCELL) dxy, data_type);
 		dxy_ptr = G_incr_void_ptr(dxy_ptr, Rast_cell_size(data_type));
 	    }
 
@@ -970,7 +970,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) pcurv_ptr) = (CELL) (scik1 * pcurv);
 		else
-		    Rast_set_raster_value_d(pcurv_ptr, (DCELL) pcurv, data_type);
+		    Rast_set_d_value(pcurv_ptr, (DCELL) pcurv, data_type);
 		pcurv_ptr =
 		    G_incr_void_ptr(pcurv_ptr, Rast_cell_size(data_type));
 	    }
@@ -979,7 +979,7 @@ int r_slope_aspect(int argc, char *argv[])
 		if (out_type == CELL_TYPE)
 		    *((CELL *) tcurv_ptr) = (CELL) (scik1 * tcurv);
 		else
-		    Rast_set_raster_value_d(tcurv_ptr, (DCELL) tcurv, data_type);
+		    Rast_set_d_value(tcurv_ptr, (DCELL) tcurv, data_type);
 		tcurv_ptr =
 		    G_incr_void_ptr(tcurv_ptr, Rast_cell_size(data_type));
 	    }

+ 1 - 1
vector/lidar/lidarlib/zones.c

@@ -283,7 +283,7 @@ void P_Aux_to_Raster(double **matrix, int fd)
 
 	for (col = 0, ptr = raster; col < ncols;
 	     col++, ptr = G_incr_void_ptr(ptr, Rast_cell_size(DCELL_TYPE))) {
-	    Rast_set_raster_value_d(ptr, (DCELL) (matrix[row][col]), DCELL_TYPE);
+	    Rast_set_d_value(ptr, (DCELL) (matrix[row][col]), DCELL_TYPE);
 	}
 	Rast_put_d_row(fd, raster);
     }

+ 1 - 1
vector/v.neighbors/main.c

@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
 
 	    if (count > 0) {
 		value = count;
-		Rast_set_raster_value_d(rp, value, CELL_TYPE);
+		Rast_set_d_value(rp, value, CELL_TYPE);
 	    }
 	    rp = G_incr_void_ptr(rp, Rast_cell_size(CELL_TYPE));
 	}