[GRASS-SVN] r56393 - grass/trunk/raster/r.watershed/seg
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 23 13:25:43 PDT 2013
Author: mmetz
Date: 2013-05-23 13:25:43 -0700 (Thu, 23 May 2013)
New Revision: 56393
Modified:
grass/trunk/raster/r.watershed/seg/do_cum.c
Log:
r.watershed.seg: fix SFD TCI
Modified: grass/trunk/raster/r.watershed/seg/do_cum.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/do_cum.c 2013-05-23 20:07:48 UTC (rev 56392)
+++ grass/trunk/raster/r.watershed/seg/do_cum.c 2013-05-23 20:25:43 UTC (rev 56393)
@@ -147,7 +147,7 @@
np_side = -1;
r_nbr = dr;
c_nbr = dc;
-#if 0
+
for (ct_dir = 0; ct_dir < sides; ct_dir++) {
/* get r, c (r_nbr, c_nbr) for neighbours */
r_nbr = r + nextdr[ct_dir];
@@ -155,21 +155,11 @@
if (dr == r_nbr && dc == c_nbr)
np_side = ct_dir;
-
- /* check that neighbour is within region */
- if (r_nbr >= 0 && r_nbr < nrows && c_nbr >= 0 &&
- c_nbr < ncols) {
-
- seg_get(&aspflag, (char *)&afdown, r_nbr, c_nbr);
- if (FLAG_GET(afdown.flag, NULLFLAG))
- break;
- }
}
-#endif
/* do not distribute flow along edges, this causes artifacts */
if (FLAG_GET(af.flag, EDGEFLAG)) {
if (FLAG_GET(af.flag, SWALEFLAG) && af.asp > 0) {
- af.asp = -1 * drain[r - r_nbr + 1][c - c_nbr + 1];
+ af.asp = -1 * drain[r - dr + 1][c - dc + 1];
}
seg_put(&aspflag, (char *)&af, r, c);
continue;
More information about the grass-commit
mailing list