[GRASS-SVN] r54550 - grass/trunk/raster/r.flow
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 6 07:18:22 PST 2013
Author: martinl
Date: 2013-01-06 07:18:22 -0800 (Sun, 06 Jan 2013)
New Revision: 54550
Modified:
grass/trunk/raster/r.flow/io.c
grass/trunk/raster/r.flow/main.c
grass/trunk/raster/r.flow/precomp.c
Log:
r.flow: progress info cosmetics
Modified: grass/trunk/raster/r.flow/io.c
===================================================================
--- grass/trunk/raster/r.flow/io.c 2013-01-06 13:53:11 UTC (rev 54549)
+++ grass/trunk/raster/r.flow/io.c 2013-01-06 15:18:22 UTC (rev 54550)
@@ -82,33 +82,36 @@
int fd, row, col;
struct Cell_head hd;
- G_message(_("Reading input files: elevation"));
-
fd = open_existing_cell_file(parm.elevin, &hd);
if (!compare_regions(®ion, &hd))
- G_fatal_error(_("Elevation file's resolution differs from current region resolution"));
+ G_fatal_error(_("Elevation raster map resolution differs from current region resolution"));
+ G_important_message(_("Reading input raster map <%s>..."), parm.elevin);
for (row = 0; row < region.rows; row++) {
+ G_percent(row, region.rows, 5);
Rast_get_d_row(fd, el.buf[row], row);
if (parm.seg)
put_row_seg(el, row);
}
+ G_percent(1, 1, 1);
if (parm.seg)
segment_flush(el.seg);
Rast_close(fd);
if (parm.aspin) {
- G_message(_("Reading input files: aspect"));
fd = open_existing_cell_file(parm.aspin, &hd);
if (!compare_regions(®ion, &hd))
G_fatal_error(_("Resolution of aspect file differs from "
"current region resolution"));
+ G_important_message(_("Reading input raster map <%s>..."), parm.aspin);
for (row = 0; row < region.rows; row++) {
+ G_percent(row, region.rows, 5);
Rast_get_d_row(fd, as.buf[row], row);
if (parm.seg)
put_row_seg(as, row);
}
+ G_percent(1, 1, 1);
if (parm.seg)
segment_flush(as.seg);
Rast_close(fd);
@@ -201,15 +204,17 @@
Rast_set_output_window(®ion);
- G_message(_("Writing density file"));
+ G_message(_("Writing output raster map <%s>..."), parm.dsout);
dsfd = Rast_open_new(parm.dsout, DCELL_TYPE);
for (row = 0; row < region.rows; row++) {
+ G_percent(row, region.rows, 5);
Rast_put_row(dsfd, get_row(ds, row), DCELL_TYPE);
for (col = 0; col < region.cols; col++)
if (ds.buf[row][col] > dsmax)
dsmax = ds.buf[row][col];
}
+ G_percent(1, 1, 1);
Rast_close(dsfd);
Rast_init_colors(&colors);
@@ -234,7 +239,7 @@
Rast_add_c_color_rule(&val1, 0, 0, 255, &val2, 0, 0, 0, &colors);
if ((mapset = G_find_file("cell", parm.dsout, "")) == NULL)
- G_fatal_error(_("Unable to find file %s"), parm.dsout);
+ G_fatal_error(_("Raster map <%s> not found"), parm.dsout);
Rast_write_colors(parm.dsout, mapset, &colors);
Rast_free_colors(&colors);
Modified: grass/trunk/raster/r.flow/main.c
===================================================================
--- grass/trunk/raster/r.flow/main.c 2013-01-06 13:53:11 UTC (rev 54549)
+++ grass/trunk/raster/r.flow/main.c 2013-01-06 15:18:22 UTC (rev 54550)
@@ -313,7 +313,7 @@
struct line_cats *cats = Vect_new_cats_struct();
int loopstep = (!parm.dsout && !parm.lgout && parm.flout) ? parm.skip : 1;
- G_message(_("Calculating maps ..."));
+ G_important_message(_("Calculating..."));
fls.px = (double *)G_calloc(parm.bound, sizeof(double));
fls.py = (double *)G_calloc(parm.bound, sizeof(double));
@@ -387,7 +387,8 @@
if (parm.lgout)
Rast_put_f_row(lgfd, lg);
}
-
+ G_percent (1, 1, 1);
+
G_free(fls.px);
G_free(fls.py);
/* G_free (fls); *//* commented 19/10/99 MN */
Modified: grass/trunk/raster/r.flow/precomp.c
===================================================================
--- grass/trunk/raster/r.flow/precomp.c 2013-01-06 13:53:11 UTC (rev 54549)
+++ grass/trunk/raster/r.flow/precomp.c 2013-01-06 15:18:22 UTC (rev 54550)
@@ -45,26 +45,26 @@
void precompute(void)
{
- G_message(_("Precomputing: e/w distances"));
+ G_verbose_message(_("Precomputing e/w distances..."));
precompute_ew_dists();
- G_message(_("Precomputing: quantization tolerances"));
+ G_verbose_message(_("Precomputing quantization tolerances..."));
precompute_epsilons();
if (parm.up) {
- G_message(_("Precomputing: inverted elevations"));
+ G_verbose_message(_("Precomputing inverted elevations..."));
upslope_correction();
}
if (!parm.aspin) {
- G_message(_("Precomputing: interpolated border elevations"));
+ G_verbose_message(_("Precomputing interpolated border elevations..."));
interpolate_border();
}
if (!parm.mem) {
if (parm.aspin) {
- G_message(_("Precomputing: re-oriented aspects"));
+ G_verbose_message(_("Precomputing re-oriented aspects..."));
reflect_and_sentinel();
}
else {
- G_message(_("Precomputing: aspects"));
+ G_verbose_message(_("Precomputing aspects..."));
precompute_aspects();
}
}
More information about the grass-commit
mailing list