[GRASS-SVN] r52607 - grass/trunk/raster/r.lake

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 9 04:31:50 PDT 2012


Author: marisn
Date: 2012-08-09 04:31:49 -0700 (Thu, 09 Aug 2012)
New Revision: 52607

Modified:
   grass/trunk/raster/r.lake/main.c
   grass/trunk/raster/r.lake/r.lake.html
Log:
Explain better meaning of depth in output, as suggested by John Helly

Modified: grass/trunk/raster/r.lake/main.c
===================================================================
--- grass/trunk/raster/r.lake/main.c	2012-08-09 09:16:13 UTC (rev 52606)
+++ grass/trunk/raster/r.lake/main.c	2012-08-09 11:31:49 UTC (rev 52607)
@@ -191,19 +191,19 @@
 	exit(EXIT_FAILURE);
 
     if (smap_opt->answer && sdxy_opt->answer)
-	G_fatal_error(_("Both seed map and coordinates cannot be specified"));
+	G_fatal_error("%s", _("Both seed map and coordinates cannot be specified"));
 
     if (!smap_opt->answer && !sdxy_opt->answer)
-	G_fatal_error(_("Seed map or seed coordinates must be set!"));
+	G_fatal_error("%s", _("Seed map or seed coordinates must be set!"));
 
     if (sdxy_opt->answer && !lake_opt->answer)
-	G_fatal_error(_("Seed coordinates and output map lake= must be set!"));
+	G_fatal_error("%s", _("Seed coordinates and output map lake= must be set!"));
 
     if (lake_opt->answer && overwrite_flag->answer)
-	G_fatal_error(_("Both lake and overwrite cannot be specified"));
+	G_fatal_error("%s", _("Both lake and overwrite cannot be specified"));
 
     if (!lake_opt->answer && !overwrite_flag->answer)
-	G_fatal_error(_("Output lake map or overwrite flag must be set!"));
+	G_fatal_error("%s", _("Output lake map or overwrite flag must be set!"));
 
     terrainmap = tmap_opt->answer;
     seedmap = smap_opt->answer;
@@ -230,7 +230,7 @@
 
 	if (start_row < 0 || start_row > rows ||
 	    start_col < 0 || start_col > cols)
-	    G_fatal_error(_("Seed point outside the current region"));
+	    G_fatal_error("%s", _("Seed point outside the current region"));
     }
 
     /* Open terran map */
@@ -244,7 +244,7 @@
     in_terran = (FCELL **) G_malloc(rows * sizeof(FCELL *));
     out_water = (FCELL **) G_malloc(rows * sizeof(FCELL *));
     if (in_terran == NULL || out_water == NULL)
-	G_fatal_error(_("G_malloc: out of memory"));
+	G_fatal_error("%s", _("G_malloc: out of memory"));
 
 
     G_debug(1, "Loading maps...");
@@ -266,7 +266,7 @@
     if (sdxy_opt->answer)
 	/* Check is water level higher than seed point */
 	if (in_terran[start_row][start_col] >= water_level)
-	    G_fatal_error(_("Given water level at seed point is below earth surface. "
+	    G_fatal_error("%s", _("Given water level at seed point is below earth surface. "
 			   "Increase water level or move seed point."));
     out_water[start_row][start_col] = 1;
 
@@ -345,10 +345,10 @@
     save_map(out_water, out_fd, rows, cols, negative_flag->answer, &min_depth,
 	     &max_depth, &area, &volume);
 
-    G_message(_("Lake depth from %f to %f"), min_depth, max_depth);
+    G_message(_("Lake depth from %f to %f (specified water level is taken as zero)"), min_depth, max_depth);
     G_message(_("Lake area %f square meters"), area);
     G_message(_("Lake volume %f cubic meters"), volume);
-    G_warning(_("Volume is correct only if lake depth (terrain raster map) is in meters"));
+    G_warning("%s", _("Volume is correct only if lake depth (terrain raster map) is in meters"));
 
     /* Close all files. Lake map gets written only now. */
     Rast_close(in_terran_fd);

Modified: grass/trunk/raster/r.lake/r.lake.html
===================================================================
--- grass/trunk/raster/r.lake/r.lake.html	2012-08-09 09:16:13 UTC (rev 52606)
+++ grass/trunk/raster/r.lake/r.lake.html	2012-08-09 11:31:49 UTC (rev 52607)
@@ -3,7 +3,8 @@
 <p>The module fills a lake to a target water level from a given start point. The user
 can think of it as <em>r.grow</em> with additional checks for elevation.  The resulting
 raster map contains cells with values representing lake depth and NULL for all other 
-cells beyond the lake.
+cells beyond the lake. Lake depth is reported relative to specified water level
+(specified level = 0 depth).
 
 <p>This module uses a 3x3 moving window approach to find all cells that
 match three criteria and to define the lake:
@@ -69,7 +70,6 @@
 
 <ul>
   <li>The entire map is loaded into RAM.</li>
-  <li>The module is NOT large file safe. (due to the previous point)</li>
   <li>A completely negative seed map will not work! At least one cell must have 
   a value > 0. Output from <em>r.lake -n</em> can NOT be used as input in the next run.</li>
 </ul>



More information about the grass-commit mailing list