[GRASS-user] r.watershed with depressions

Charles Ehlschlaeger c.ehlschlaeger at insightbb.com
Tue Mar 20 10:07:20 EDT 2007


The depression map should have ones where there are sinkholes and zeros
where there are no sinkholes. Did your depression map have "no data" at all
other points? If so, that probably caused the problem.

Line 166 of ../src/raster/r.watershed/ram/init_vars.c does not check for no
data values in the depression map (silly of the younger me). It has been too
long since I last wrote code for GRASS to remember how to check for "no
data": that check should be added. Intuitively, "no data" should be treated
as not a true depression in the code. Line 166 should be replaced with the
following code (NODATAVALUE being some variable indicating the no data value
for the depression map):

			if( buf[c] != NODATAVALUE) {
				asp[SEG_INDEX(asp_seg, r, c)] = buf[c];
			} else {
				asp[SEG_INDEX(asp_seg, r, c)] = 0;
			}

Chuck Ehlschlaeger, Associate Professor & GIS Center Director
Department  of  Geography,      Western  Illinois  University
215 Tillman Hall,   1 University Circle,  Macomb,  IL   61455
cre111 at wiu.edu,    phone: 309-298-1841,     fax: 309-298-3003


-----Original Message-----
From: grassuser-bounces at grass.itc.it [mailto:grassuser-bounces at grass.itc.it]
On Behalf Of Carlos "Guâno" Grohmann
Sent: Monday, March 19, 2007 1:44 PM
To: grass user
Subject: [GRASS-user] r.watershed with depressions

Hello all,

I was palying around with r.watershed. If I don't enter a map for real
depressions, it takes about 10 minutes to run, but the streams are not
right. It is a karstic area, so I have some sinkholes, but the streams
do not respect the depressions. So I decided to use the "real
depressions" option. I have a vector layer with points in the
sinkholes, which I converted to raster, with value=1. When I run
r.watershed with this depressions map as an option, it takes about 3
hours to run and the produced maps are entirely NULL.

What is the right way to run this command?

thanks

Carlos

-- 
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

_______________________________________________
grassuser mailing list
grassuser at grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.14/727 - Release Date: 3/19/2007
11:49 AM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.15/728 - Release Date: 3/20/2007
8:07 AM
 




More information about the grass-user mailing list