[GRASS-SVN] r38128 - in grass/trunk: imagery/i.pca include
lib/raster raster/r.cost raster/r.in.ascii raster/r.in.mat
raster/r.in.xyz raster/r.null raster/r.patch raster/r.proj
raster/r.slope.aspect raster/r.stats raster/r.to.vect
raster/r.walk swig/perl/R_slope_aspect/r_slope_aspect
vector/lidar/lidarlib vector/v.neighbors
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 30 12:53:16 EDT 2009
Author: martinl
Date: 2009-06-30 12:53:15 -0400 (Tue, 30 Jun 2009)
New Revision: 38128
Modified:
grass/trunk/imagery/i.pca/main.c
grass/trunk/include/raster.h
grass/trunk/lib/raster/cats.c
grass/trunk/lib/raster/color_look.c
grass/trunk/lib/raster/color_rule.c
grass/trunk/lib/raster/get_row.c
grass/trunk/lib/raster/put_row.c
grass/trunk/lib/raster/raster.c
grass/trunk/raster/r.cost/main.c
grass/trunk/raster/r.in.ascii/main.c
grass/trunk/raster/r.in.mat/main.c
grass/trunk/raster/r.in.xyz/main.c
grass/trunk/raster/r.in.xyz/support.c
grass/trunk/raster/r.null/mask.c
grass/trunk/raster/r.patch/do_patch.c
grass/trunk/raster/r.proj/bilinear.c
grass/trunk/raster/r.proj/bilinear_f.c
grass/trunk/raster/r.proj/cubic.c
grass/trunk/raster/r.proj/cubic_f.c
grass/trunk/raster/r.proj/nearest.c
grass/trunk/raster/r.slope.aspect/main.c
grass/trunk/raster/r.stats/raw_stats.c
grass/trunk/raster/r.to.vect/areas.c
grass/trunk/raster/r.walk/main.c
grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c
grass/trunk/vector/lidar/lidarlib/zones.c
grass/trunk/vector/v.neighbors/main.c
Log:
rasterlib: fns from raster.c renamed, see
http://trac.osgeo.org/grass/wiki/Grass7/RasterLib
Modified: grass/trunk/imagery/i.pca/main.c
===================================================================
--- grass/trunk/imagery/i.pca/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/imagery/i.pca/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -264,7 +264,7 @@
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 @@
}
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 @@
/* 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 @@
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 @@
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);
}
}
Modified: grass/trunk/include/raster.h
===================================================================
--- grass/trunk/include/raster.h 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/include/raster.h 2009-06-30 16:53:15 UTC (rev 38128)
@@ -471,12 +471,12 @@
/* 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 *);
Modified: grass/trunk/lib/raster/cats.c
===================================================================
--- grass/trunk/lib/raster/cats.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/cats.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -406,7 +406,7 @@
/* 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 @@
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 *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 @@
{
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 @@
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 @@
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 @@
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;
}
Modified: grass/trunk/lib/raster/color_look.c
===================================================================
--- grass/trunk/lib/raster/color_look.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/color_look.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -256,7 +256,7 @@
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;
Modified: grass/trunk/lib/raster/color_rule.c
===================================================================
--- grass/trunk/lib/raster/color_rule.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/color_rule.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -250,8 +250,8 @@
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;
Modified: grass/trunk/lib/raster/get_row.c
===================================================================
--- grass/trunk/lib/raster/get_row.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/get_row.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -675,7 +675,7 @@
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);
}
Modified: grass/trunk/lib/raster/put_row.c
===================================================================
--- grass/trunk/lib/raster/put_row.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/put_row.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -561,7 +561,7 @@
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);
Modified: grass/trunk/lib/raster/raster.c
===================================================================
--- grass/trunk/lib/raster/raster.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/lib/raster/raster.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -88,7 +88,7 @@
* \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 @@
* \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 @@
* \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 @@
*
* \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 @@
*
* \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 @@
*
* \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;
Modified: grass/trunk/raster/r.cost/main.c
===================================================================
--- grass/trunk/raster/r.cost/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.cost/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -659,7 +659,7 @@
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);
}
Modified: grass/trunk/raster/r.in.ascii/main.c
===================================================================
--- grass/trunk/raster/r.in.ascii/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.in.ascii/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -219,7 +219,7 @@
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);
}
}
Modified: grass/trunk/raster/r.in.mat/main.c
===================================================================
--- grass/trunk/raster/r.in.mat/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.in.mat/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -434,17 +434,17 @@
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:
Modified: grass/trunk/raster/r.in.xyz/main.c
===================================================================
--- grass/trunk/raster/r.in.xyz/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.in.xyz/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -699,14 +699,14 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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));
}
Modified: grass/trunk/raster/r.in.xyz/support.c
===================================================================
--- grass/trunk/raster/r.in.xyz/support.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.in.xyz/support.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -37,7 +37,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
}
Modified: grass/trunk/raster/r.null/mask.c
===================================================================
--- grass/trunk/raster/r.null/mask.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.null/mask.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -30,9 +30,9 @@
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));
Modified: grass/trunk/raster/r.patch/do_patch.c
===================================================================
--- grass/trunk/raster/r.patch/do_patch.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.patch/do_patch.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -15,7 +15,7 @@
/* 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;
}
Modified: grass/trunk/raster/r.proj/bilinear.c
===================================================================
--- grass/trunk/raster/r.proj/bilinear.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.proj/bilinear.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -64,5 +64,5 @@
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);
}
Modified: grass/trunk/raster/r.proj/bilinear_f.c
===================================================================
--- grass/trunk/raster/r.proj/bilinear_f.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.proj/bilinear_f.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -44,5 +44,5 @@
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);
}
Modified: grass/trunk/raster/r.proj/cubic.c
===================================================================
--- grass/trunk/raster/r.proj/cubic.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.proj/cubic.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -70,5 +70,5 @@
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);
}
Modified: grass/trunk/raster/r.proj/cubic_f.c
===================================================================
--- grass/trunk/raster/r.proj/cubic_f.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.proj/cubic_f.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -48,6 +48,6 @@
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);
}
}
Modified: grass/trunk/raster/r.proj/nearest.c
===================================================================
--- grass/trunk/raster/r.proj/nearest.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.proj/nearest.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -37,5 +37,5 @@
return;
}
- Rast_set_raster_value_f(obufptr, *cellp, cell_type);
+ Rast_set_f_value(obufptr, *cellp, cell_type);
}
Modified: grass/trunk/raster/r.slope.aspect/main.c
===================================================================
--- grass/trunk/raster/r.slope.aspect/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.slope.aspect/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -811,10 +811,10 @@
*((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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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));
}
Modified: grass/trunk/raster/r.stats/raw_stats.c
===================================================================
--- grass/trunk/raster/r.stats/raw_stats.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.stats/raw_stats.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -53,7 +53,7 @@
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;
*/
Modified: grass/trunk/raster/r.to.vect/areas.c
===================================================================
--- grass/trunk/raster/r.to.vect/areas.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.to.vect/areas.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -100,7 +100,7 @@
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 */
Modified: grass/trunk/raster/r.walk/main.c
===================================================================
--- grass/trunk/raster/r.walk/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/raster/r.walk/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -909,7 +909,7 @@
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);
}
Modified: grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c
===================================================================
--- grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -837,10 +837,10 @@
*((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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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));
}
Modified: grass/trunk/vector/lidar/lidarlib/zones.c
===================================================================
--- grass/trunk/vector/lidar/lidarlib/zones.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/vector/lidar/lidarlib/zones.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -283,7 +283,7 @@
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);
}
Modified: grass/trunk/vector/v.neighbors/main.c
===================================================================
--- grass/trunk/vector/v.neighbors/main.c 2009-06-30 16:20:43 UTC (rev 38127)
+++ grass/trunk/vector/v.neighbors/main.c 2009-06-30 16:53:15 UTC (rev 38128)
@@ -136,7 +136,7 @@
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));
}
More information about the grass-commit
mailing list