[GRASS-SVN] r50187 - grass/trunk/raster3d/r3.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 14 19:42:44 EST 2012
Author: huhabla
Date: 2012-01-14 16:42:44 -0800 (Sat, 14 Jan 2012)
New Revision: 50187
Modified:
grass/trunk/raster3d/r3.info/r3.info.main.c
Log:
Fixed NULL map handling
Modified: grass/trunk/raster3d/r3.info/r3.info.main.c
===================================================================
--- grass/trunk/raster3d/r3.info/r3.info.main.c 2012-01-15 00:41:17 UTC (rev 50186)
+++ grass/trunk/raster3d/r3.info/r3.info.main.c 2012-01-15 00:42:44 UTC (rev 50187)
@@ -122,8 +122,9 @@
exit(EXIT_FAILURE);
name = G_store(opt1->answer);
+ mapset = G_find_raster3d(name, "");
- if ((mapset = G_find_raster3d(name, "")) == NULL)
+ if (mapset == NULL)
G_fatal_error(_("3D Raster map <%s> not found"), name);
/*We need to open the map */
@@ -343,8 +344,15 @@
G_fatal_error(_("Unable to read range of 3D raster map <%s>"), name);
Rast3d_range_min_max(g3map, &dmin, &dmax);
- format_double(dmin, tmp1);
- format_double(dmax, tmp2);
+
+ if(dmin != dmin)
+ sprintf(tmp1, "%s", "NULL");
+ else
+ format_double(dmin, tmp1);
+ if(dmax != dmax)
+ sprintf(tmp2, "%s", "NULL");
+ else
+ format_double(dmax, tmp2);
if (G_asprintf
(&line, " Range of data: min = %10s max = %10s", tmp1,
@@ -405,8 +413,14 @@
G_fatal_error(_("Unable to read range of 3D raster map <%s>"), name);
Rast3d_range_min_max(g3map, &dmin, &dmax);
- fprintf(out, "min=%f\n", dmin);
- fprintf(out, "max=%f\n", dmax);
+ if(dmin != dmin)
+ fprintf(out, "min=NULL\n");
+ else
+ fprintf(out, "min=%f\n", dmin);
+ if(dmax != dmax)
+ fprintf(out, "max=NULL\n");
+ else
+ fprintf(out, "max=%f\n", dmax);
} /*Region */
if (gflag->answer) {
More information about the grass-commit
mailing list