[GRASS-SVN] r74018 - grass-addons/grass7/raster/r.accumulate
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 25 21:06:37 PST 2019
Author: hcho
Date: 2019-01-25 21:06:37 -0800 (Fri, 25 Jan 2019)
New Revision: 74018
Modified:
grass-addons/grass7/raster/r.accumulate/accumulate.c
grass-addons/grass7/raster/r.accumulate/calculate_lfp.c
grass-addons/grass7/raster/r.accumulate/delineate_streams.c
grass-addons/grass7/raster/r.accumulate/main.c
grass-addons/grass7/raster/r.accumulate/r.accumulate.html
Log:
r.accumulate: run grass_indent.sh
Modified: grass-addons/grass7/raster/r.accumulate/accumulate.c
===================================================================
--- grass-addons/grass7/raster/r.accumulate/accumulate.c 2019-01-26 05:02:55 UTC (rev 74017)
+++ grass-addons/grass7/raster/r.accumulate/accumulate.c 2019-01-26 05:06:37 UTC (rev 74018)
@@ -12,7 +12,7 @@
G_message(_("Accumulating flows..."));
for (row = 0; row < rows; row++) {
- G_percent(row, rows, 1);
+ G_percent(row, rows, 1);
for (col = 0; col < cols; col++)
trace_up(dir_buf, weight_buf, accum_buf, done, neg, row, col);
}
Modified: grass-addons/grass7/raster/r.accumulate/calculate_lfp.c
===================================================================
--- grass-addons/grass7/raster/r.accumulate/calculate_lfp.c 2019-01-26 05:02:55 UTC (rev 74017)
+++ grass-addons/grass7/raster/r.accumulate/calculate_lfp.c 2019-01-26 05:06:37 UTC (rev 74018)
@@ -54,7 +54,7 @@
int col = (int)Rast_easting_to_col(outlet_pl->x[i], &window);
int n;
- G_percent(i, outlet_pl->n, 1);
+ G_percent(i, outlet_pl->n, 1);
/* if the outlet is outside the computational region, skip */
if (row < 0 || row >= rows || col < 0 || col >= cols) {
Modified: grass-addons/grass7/raster/r.accumulate/delineate_streams.c
===================================================================
--- grass-addons/grass7/raster/r.accumulate/delineate_streams.c 2019-01-26 05:02:55 UTC (rev 74017)
+++ grass-addons/grass7/raster/r.accumulate/delineate_streams.c 2019-01-26 05:06:37 UTC (rev 74018)
@@ -28,7 +28,7 @@
/* loop through all cells to find headwater cells */
G_message(_("Delineating streams..."));
for (row = 0; row < rows; row++) {
- G_percent(row, rows, 1);
+ G_percent(row, rows, 1);
for (col = 0; col < cols; col++) {
int i, j;
int nup = 0;
Modified: grass-addons/grass7/raster/r.accumulate/main.c
===================================================================
--- grass-addons/grass7/raster/r.accumulate/main.c 2019-01-26 05:02:55 UTC (rev 74017)
+++ grass-addons/grass7/raster/r.accumulate/main.c 2019-01-26 05:06:37 UTC (rev 74018)
@@ -57,8 +57,8 @@
struct Flag *conf;
} flag;
char *desc;
- char *dir_name, *weight_name, *input_accum_name, *accum_name, *stream_name,
- *outlet_name, *lfp_name;
+ char *dir_name, *weight_name, *input_accum_name, *accum_name,
+ *stream_name, *outlet_name, *lfp_name;
int dir_fd;
double dir_format, thresh;
struct Range dir_range;
@@ -339,12 +339,12 @@
Vect_close(&Map);
- if (driver) {
- if (n < outlet_pl.n)
- G_fatal_error(_("Too few longest flow path IDs specified"));
- if (n > outlet_pl.n)
- G_fatal_error(_("Too many longest flow path IDs specified"));
- }
+ if (driver) {
+ if (n < outlet_pl.n)
+ G_fatal_error(_("Too few longest flow path IDs specified"));
+ if (n > outlet_pl.n)
+ G_fatal_error(_("Too many longest flow path IDs specified"));
+ }
}
thresh = opt.thresh->answer ? atof(opt.thresh->answer) : 0.0;
@@ -361,7 +361,7 @@
dir_buf.c = G_malloc(rows * sizeof(CELL *));
G_message(_("Reading direction map..."));
for (row = 0; row < rows; row++) {
- G_percent(row, rows, 1);
+ G_percent(row, rows, 1);
done[row] = G_calloc(cols, 1);
dir_buf.c[row] = Rast_allocate_c_buf();
Rast_get_c_row(dir_fd, dir_buf.c[row], row);
@@ -387,15 +387,15 @@
weight_buf.rows = rows;
weight_buf.cols = cols;
weight_buf.map.v = (void **)G_malloc(rows * sizeof(void *));
- G_message(_("Reading weight map..."));
+ G_message(_("Reading weight map..."));
for (row = 0; row < rows; row++) {
- G_percent(row, rows, 1);
+ G_percent(row, rows, 1);
weight_buf.map.v[row] =
(void *)Rast_allocate_buf(weight_buf.type);
Rast_get_row(weight_fd, weight_buf.map.v[row], row,
weight_buf.type);
}
- G_percent(1, 1, 1);
+ G_percent(1, 1, 1);
Rast_close(weight_fd);
}
/* create non-weighted accumulation if input accumulation is not given */
@@ -407,20 +407,20 @@
int accum_fd = Rast_open_old(input_accum_name, "");
accum_buf.type = Rast_get_map_type(accum_fd);
- G_message(_("Reading accumulation map..."));
+ G_message(_("Reading accumulation map..."));
for (row = 0; row < rows; row++) {
- G_percent(row, rows, 1);
+ G_percent(row, rows, 1);
accum_buf.map.v[row] = (void *)Rast_allocate_buf(accum_buf.type);
Rast_get_row(accum_fd, accum_buf.map.v[row], row, accum_buf.type);
}
- G_percent(1, 1, 1);
+ G_percent(1, 1, 1);
Rast_close(accum_fd);
}
/* accumulate flows if input accumulation is not given */
else {
- for (row = 0; row < rows; row++)
- accum_buf.map.v[row] = (void *)Rast_allocate_buf(accum_buf.type);
- accumulate(&dir_buf, &weight_buf, &accum_buf, done, neg);
+ for (row = 0; row < rows; row++)
+ accum_buf.map.v[row] = (void *)Rast_allocate_buf(accum_buf.type);
+ accumulate(&dir_buf, &weight_buf, &accum_buf, done, neg);
}
/* write out buffer to the accumulatoin map if requested */
@@ -428,7 +428,7 @@
int accum_fd = Rast_open_new(accum_name, accum_buf.type);
struct History hist;
- G_message(_("Writing accumulation map..."));
+ G_message(_("Writing accumulation map..."));
for (row = 0; row < rows; row++)
Rast_put_row(accum_fd, accum_buf.map.v[row], accum_buf.type);
Rast_close(accum_fd);
Modified: grass-addons/grass7/raster/r.accumulate/r.accumulate.html
===================================================================
--- grass-addons/grass7/raster/r.accumulate/r.accumulate.html 2019-01-26 05:02:55 UTC (rev 74017)
+++ grass-addons/grass7/raster/r.accumulate/r.accumulate.html 2019-01-26 05:06:37 UTC (rev 74018)
@@ -38,7 +38,11 @@
accumulation is calculated by single flow direction (SFD) routing and may not
be comparable to the result from multiple flow direction (MFD) routing.
-<p>The module requires flow accumulation for any output, so it will internally accumulate flows every time it runs unless <b>input_accumulation</b> option is provided to save computational time by not repeating this process. In this case, it is important to use flow accumulation consistent with the flow direction map (e.g., <b>accumulation</b> output from this module).
+<p>The module requires flow accumulation for any output, so it will internally
+accumulate flows every time it runs unless <b>input_accumulation</b> option is
+provided to save computational time by not repeating this process. In this
+case, it is important to use flow accumulation consistent with the flow
+direction map (e.g., <b>accumulation</b> output from this module).
<h3>Stream network delineation</h3>
More information about the grass-commit
mailing list