瀏覽代碼

user specified nodata was being clobbered by default if type= was not given; missing space in warning msg (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33987 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 年之前
父節點
當前提交
91b32911a9
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. 8 8
      raster/r.out.gdal/main.c

+ 8 - 8
raster/r.out.gdal/main.c

@@ -334,15 +334,15 @@ int import_band(GDALDatasetH hMEMDS, int band, const char *name,
 	}
 	}
     }
     }
 
 
-    if (n_nulls > 0) {
+    if (n_nulls > 0) {  /* TODO: && nodata_param NOT specified */
 	if (maptype == CELL_TYPE)
 	if (maptype == CELL_TYPE)
 	    G_warning(_("Input raster map contains cells with NULL-value (no-data). "
 	    G_warning(_("Input raster map contains cells with NULL-value (no-data). "
-		       "The value %d was used to represent no-data values in the input map."
+		       "The value %d was used to represent no-data values in the input map. "
 		       "You can specify nodata value by %s parameter."),
 		       "You can specify nodata value by %s parameter."),
 		      (int)nodataval, nodatakey);
 		      (int)nodataval, nodatakey);
 	else
 	else
 	    G_warning(_("Input raster map contains cells with NULL-value (no-data). "
 	    G_warning(_("Input raster map contains cells with NULL-value (no-data). "
-		       "The value %g was used to represent no-data values in the input map."
+		       "The value %g was used to represent no-data values in the input map. "
 		       "You can specify nodata value by %s parameter."),
 		       "You can specify nodata value by %s parameter."),
 		      nodataval, nodatakey);
 		      nodataval, nodatakey);
     }
     }
@@ -599,11 +599,6 @@ int main(int argc, char *argv[])
 	}
 	}
     }
     }
 
 
-    /* force nodata-value if needed */
-    if (nodataopt->answer) {
-	nodataval = atof(nodataopt->answer);
-    }
-
     /* If file type not set by user ... */
     /* If file type not set by user ... */
     /* Get min/max values. */
     /* Get min/max values. */
     if (G_read_fp_range(ref.file[0].name, ref.file[0].mapset, &sRange) == -1) {
     if (G_read_fp_range(ref.file[0].name, ref.file[0].mapset, &sRange) == -1) {
@@ -645,6 +640,11 @@ int main(int argc, char *argv[])
 	}
 	}
     }
     }
 
 
+    /* force nodata-value if needed */
+    if (nodataopt->answer) {
+	nodataval = atof(nodataopt->answer);
+    }
+
     G_debug(3, "Input map datatype=%s\n",
     G_debug(3, "Input map datatype=%s\n",
 	    (maptype == CELL_TYPE ? "CELL" :
 	    (maptype == CELL_TYPE ? "CELL" :
 	     (maptype == DCELL_TYPE ? "DCELL" :
 	     (maptype == DCELL_TYPE ? "DCELL" :