[GRASS-SVN] r45697 - grass/trunk/raster/r.reclass
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 17 22:02:04 EDT 2011
Author: hamish
Date: 2011-03-17 19:02:03 -0700 (Thu, 17 Mar 2011)
New Revision: 45697
Modified:
grass/trunk/raster/r.reclass/main.c
Log:
export floats and doubles with correct precision (#335, merge from devbr6)
Modified: grass/trunk/raster/r.reclass/main.c
===================================================================
--- grass/trunk/raster/r.reclass/main.c 2011-03-17 23:00:39 UTC (rev 45696)
+++ grass/trunk/raster/r.reclass/main.c 2011-03-18 02:02:03 UTC (rev 45697)
@@ -28,7 +28,7 @@
struct Categories cats;
struct FPRange range;
DCELL min, max;
- int fp;
+ RASTER_MAP_TYPE map_type;
char buf[1024];
RULE *rules, *tail;
int any;
@@ -92,7 +92,7 @@
tty = isatty(fileno(srcfp));
Rast_init_cats("", &cats);
- fp = Rast_map_is_fp(parm.input->answer, old_mapset);
+ map_type = Rast_map_type(parm.input->answer, old_mapset);
Rast_read_fp_range(parm.input->answer, old_mapset, &range);
Rast_get_fp_range_min_max(&range, &min, &max);
rules = tail = NULL;
@@ -101,11 +101,14 @@
if (tty) {
fprintf(stdout,
_("Enter rule(s), \"end\" when done, \"help\" if you need it\n"));
- if (fp)
- fprintf(stdout, _("fp: Data range is %.25f to %.25f\n"),
+ if (map_type == FCELL_TYPE)
+ fprintf(stdout, _("FCELL: Data range is %.7g to %.7g\n"),
(double)min, (double)max);
+ else if (map_type == DCELL_TYPE)
+ fprintf(stdout, _("DCELL: Data range is %.15g to %.15g\n"),
+ (double)min, (double)max);
else
- fprintf(stdout, _("Data range is %ld to %ld\n"), (long)min,
+ fprintf(stdout, _("CELL: Data range is %ld to %ld\n"), (long)min,
(long)max);
}
More information about the grass-commit
mailing list