[GRASS-SVN] r62518 - grass/trunk/raster/r.recode
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Nov 1 09:47:20 PDT 2014
Author: annakrat
Date: 2014-11-01 09:47:19 -0700 (Sat, 01 Nov 2014)
New Revision: 62518
Modified:
grass/trunk/raster/r.recode/read_rules.c
Log:
r.recode: fix #2053 - change input type to be always double
Modified: grass/trunk/raster/r.recode/read_rules.c
===================================================================
--- grass/trunk/raster/r.recode/read_rules.c 2014-11-01 10:11:04 UTC (rev 62517)
+++ grass/trunk/raster/r.recode/read_rules.c 2014-11-01 16:47:19 UTC (rev 62518)
@@ -50,7 +50,8 @@
DCELL oLow, oHigh, nLow, nHigh;
int line, n;
- in_type = out_type = CELL_TYPE;
+ in_type = DCELL_TYPE;
+ out_type = CELL_TYPE;
rules = (char **)G_malloc(INCR * sizeof(char *));
rule_size = INCR;
@@ -98,16 +99,12 @@
lookup the values in the quant table */
switch (sscanf(buf, "%lf:%lf:%lf:%lf", &oLow, &oHigh, &nLow, &nHigh)) {
case 3:
- update_type(&in_type, oLow);
- update_type(&in_type, oHigh);
update_type(&out_type, nLow);
update_rules(buf);
Rast_fpreclass_add_rule(&rcl_struct, oLow, oHigh, nLow, nLow);
break;
case 4:
- update_type(&in_type, oLow);
- update_type(&in_type, oHigh);
update_type(&out_type, nLow);
update_type(&out_type, nHigh);
update_rules(buf);
@@ -116,13 +113,11 @@
default:
if (sscanf(buf, "%lf:*:%lf", &oLow, &nLow) == 2) {
- update_type(&in_type, oLow);
update_type(&out_type, nLow);
update_rules(buf);
Rast_fpreclass_set_pos_infinite_rule(&rcl_struct, oLow, nLow);
}
else if (sscanf(buf, "*:%lf:%lf", &oHigh, &nLow) == 2) {
- update_type(&in_type, oHigh);
update_type(&out_type, nLow);
update_rules(buf);
Rast_fpreclass_set_neg_infinite_rule(&rcl_struct, oHigh, nLow);
More information about the grass-commit
mailing list