[GRASS-dev] r.flow with barrier fails

Glynn Clements glynn at gclements.plus.com
Mon Feb 19 13:19:13 EST 2007


J-Báchym Čepický wrote:-A

> Hi, r.flow fails, when used with barrin option:
> 
> r.flow elevin=elevation.dem barin=roads flout=streams
> Reading input files: elevation
> Reading input files: barrier
> Segmentation fault
> 
> that is, because dsout option is not defined and read_input_files()
> (io.c) tryes to store something in ds structure
> 
> when dsout option is defined, you get no reasonable result:
> 
> r.flow elevin=elevation.dem barin=roads flout=streams dsout=density
> d.rast density
> 
> what to do?

Probably this:

--- raster/r.flow/io.c	7 Feb 2007 05:24:40 -0000	1.14
+++ raster/r.flow/io.c	19 Feb 2007 18:18:41 -0000
@@ -126,7 +126,7 @@
 	    for (col = 0; col < region.cols; col++)
 	    {
 		BM_set(bitbar, col, row, (barc[col] != 0));
-		if (barc[col] != 0)
+		if (ds.buf && barc[col] != 0)
 		    put(ds, row, col, -1);
 	    }
 	}

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list