[GRASS-SVN] r42118 - grass/branches/develbranch_6/raster/r.out.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 5 09:16:46 EDT 2010


Author: mmetz
Date: 2010-05-05 09:16:45 -0400 (Wed, 05 May 2010)
New Revision: 42118

Modified:
   grass/branches/develbranch_6/raster/r.out.gdal/export_band.c
   grass/branches/develbranch_6/raster/r.out.gdal/main.c
Log:
human-readable numbers

Modified: grass/branches/develbranch_6/raster/r.out.gdal/export_band.c
===================================================================
--- grass/branches/develbranch_6/raster/r.out.gdal/export_band.c	2010-05-05 13:08:23 UTC (rev 42117)
+++ grass/branches/develbranch_6/raster/r.out.gdal/export_band.c	2010-05-05 13:16:45 UTC (rev 42118)
@@ -180,10 +180,11 @@
 	    G_percent(row + 1, rows, 2);
 	}
     }
+    G_debug(1, "min %g max %g", dfCellMin, dfCellMax);
 
     /* can the GDAL datatype hold the data range to be exported ? */
     /* f-flag does not override */
-    if (exact_range_check(export_datatype, dfCellMin, dfCellMax, name)) {
+    if (exact_range_check(dfCellMin, dfCellMax, export_datatype, name)) {
 	G_warning("Raster export results in data loss.");
 	ret = -2;
     }
@@ -511,7 +512,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_BYTE_MIN,
 		      TYPE_BYTE_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -523,7 +524,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_UINT16_MIN,
 		      TYPE_UINT16_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -536,7 +537,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_INT16_MIN,
 		      TYPE_INT16_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -549,7 +550,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_INT32_MIN,
 		      TYPE_INT32_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -561,7 +562,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %u - %u"),
 		      GDALGetDataTypeName(datatype), TYPE_UINT32_MIN,
 		      TYPE_UINT32_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -571,10 +572,10 @@
     case GDT_CFloat32:
 	if (min < TYPE_FLOAT32_MIN || max > TYPE_FLOAT32_MAX) {
 	    G_warning(_("Selected GDAL datatype does not cover data range."));
-	    G_warning(_("GDAL datatype: %s, range: %f - %f"),
+	    G_warning(_("GDAL datatype: %s, range: %g - %g"),
 		      GDALGetDataTypeName(datatype), TYPE_FLOAT32_MIN,
 		      TYPE_FLOAT32_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else
@@ -585,10 +586,10 @@
 	/* not possible because DCELL is FLOAT64, not 128bit floating point, but anyway... */
 	if (min < TYPE_FLOAT64_MIN || max > TYPE_FLOAT64_MAX) {
 	    G_warning(_("Selected GDAL datatype does not cover data range."));
-	    G_warning(_("GDAL datatype: %s, range: %f - %f"),
+	    G_warning(_("GDAL datatype: %s, range: %g - %g"),
 		      GDALGetDataTypeName(datatype), TYPE_FLOAT64_MIN,
 		      TYPE_FLOAT64_MAX);
-	    G_warning(_("Raster map <%s> range: %f - %f"), name, min, max);
+	    G_warning(_("Raster map <%s> range: %g - %g"), name, min, max);
 	    return 1;
 	}
 	else

Modified: grass/branches/develbranch_6/raster/r.out.gdal/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.out.gdal/main.c	2010-05-05 13:08:23 UTC (rev 42117)
+++ grass/branches/develbranch_6/raster/r.out.gdal/main.c	2010-05-05 13:16:45 UTC (rev 42118)
@@ -500,7 +500,7 @@
 	     &cellhead, maptype, nodataval, nodataopt->key,
 	     default_nodataval);
 
-	/* nodata problem */
+	/* nodata value is present in the data to be exported */
 	if (retval == -1) {
 	    if (flag_f->answer)
 		G_warning(_("Forcing raster export."));
@@ -692,7 +692,7 @@
 	    G_warning(_("GDAL datatype: %s, range: %g - %g"),
 		      GDALGetDataTypeName(datatype), TYPE_FLOAT32_MIN,
 		      TYPE_FLOAT32_MAX);
-	    G_warning(_("Range to be exported: %f - %f"), min, max);
+	    G_warning(_("Range to be exported: %g - %g"), min, max);
 	    return 1;
 	}
 	else
@@ -717,7 +717,7 @@
 	 * accordingly below for the other GDAL types */
 	if (nodataval != (double)(GByte)(CELL) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %d by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %d by selected GDAL datatype."),
 		      nodataval, (GByte)(CELL) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_BYTE_MIN,
@@ -730,7 +730,7 @@
     case GDT_UInt16:
 	if (nodataval != (double)(GUInt16)(CELL) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %d by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %d by selected GDAL datatype."),
 		      nodataval, (GUInt16)(CELL) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %u - %u"),
 		      GDALGetDataTypeName(datatype), TYPE_UINT16_MIN,
@@ -744,7 +744,7 @@
     case GDT_CInt16:
 	if (nodataval != (double)(GInt16)(CELL) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %d by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %d by selected GDAL datatype."),
 		      nodataval, (GInt16)(CELL) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_INT16_MIN,
@@ -757,7 +757,7 @@
     case GDT_UInt32:
 	if (nodataval != (double)(GUInt32)(DCELL) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %d by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %d by selected GDAL datatype."),
 		      nodataval, (GUInt32)(DCELL) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %u - %u"),
 		      GDALGetDataTypeName(datatype), TYPE_UINT32_MIN,
@@ -772,7 +772,7 @@
     	/* GInt32 is equal to CELL, but that may change in the future */
 	if (nodataval != (double)(GInt32)(CELL) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %d by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %d by selected GDAL datatype."),
 		      nodataval, (GInt32)(CELL) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %d - %d"),
 		      GDALGetDataTypeName(datatype), TYPE_INT32_MIN,
@@ -786,7 +786,7 @@
     case GDT_CFloat32:
 	if (nodataval != (double)(float) nodataval) {
 	    G_warning(_("Mismatch between metadata nodata value and actual nodata value in exported raster: "
-		       "specified nodata value %f gets converted to %f by selected GDAL datatype."),
+		       "specified nodata value %g gets converted to %g by selected GDAL datatype."),
 		      nodataval, (float) nodataval);
 	    G_warning(_("GDAL datatype: %s, valid range: %g - %g"),
 		      GDALGetDataTypeName(datatype), TYPE_FLOAT32_MIN,



More information about the grass-commit mailing list