Opened 12 years ago
Last modified 9 years ago
#1924 new defect
r.watershed - empty stream segment map
Reported by: | jradinger | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 6.4.6 |
Component: | Raster | Version: | svn-trunk |
Keywords: | Cc: | ||
CPU: | x86-32 | Platform: | Linux |
Description
I am running GRASS 7 SVN (Rev55666, last revision of r.watershed) and face following two problems with r.watershed:
1) When running with treshhold = 2 I don't get any errors (one warning, see below), a flow direction map is produced correctly but the stream-segments map is empty. This was (and is still if nothing has changed since one week) in GRASS 6.5. Here the debug output:
r.watershed --overwrite elevation=distance_raster_tmp_27369@Fidimo_test threshold=2 drainage=flow_direction_test stream=segments_test D1/1: Mode: All in RAM SECTION 1a (of 5): Initiating Memory. D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster2(): name=distance_raster_tmp_27369 mapset=Fidimo_test D1/1: G_find_raster(): name=MASK mapset=Fidimo_test SECTION 1b (of 5): Determining Offmap Flow. SECTION 2: A* Search. SECTION 3a: Accumulating Surface Flow with MFD. D1/1: MFD convergence factor set to 5. D1/1: ns contour: 41.4214 D1/1: ew contour: 41.4214 D1/1: diag contour: 41.4214 SECTION 3b: Adjusting drainage directions. SECTION 4: Watershed determination. SECTION 5: Closing Maps. D1/1: 0 basins created WARNING: No basins were created. Verify threshold and region settings. D1/1: Too many subbasins to reasonably check for color brightness D1/1: close segments_test compressed D1/1: G_find_raster2(): name=segments_test mapset=Fidimo_test D1/1: G_find_raster2(): name=segments_test mapset=Fidimo_test D1/1: close flow_direction_test compressed D1/1: G_find_raster2(): name=flow_direction_test mapset=Fidimo_test D1/1: G_find_raster2(): name=flow_direction_test mapset=Fidimo_test (Wed Apr 10 09:55:17 2013) Command finished (0 sec)
What does the warning mean? My region settings:
g.region -p projection: 1 (UTM) zone: 13 datum: nad27 ellipsoid: clark66 north: 4928000 south: 4914000 west: 590000 east: 609000 nsres: 100 ewres: 100 rows: 140 cols: 190 cells: 26600
2) When running with treshold = 0 (default), I get following Error:
r.watershed --overwrite elevation=distance_raster_tmp_27369@Fidimo_test threshold=0 drainage=flow_direction_test stream=segments_test D1/1: Mode: All in RAM ERROR: USAGE for basin delineation: /usr/local/grass-7.0.svn/etc/r.watershed/ram -4 elevation=elevation_map threshold=swale_threshold [flow=overland_flow_map] [drainage=drain_direction_map] [depression=depression_map] [accumulation=accumulation_map] [basin=watershed_basin_map] [stream=stream_segment_map] USAGE for slope length determination: /usr/local/grass-7.0.svn/etc/r.watershed/ram [-4] elevation=elevation_map threshold=swale_threshold [drainage=drain_direction_map] [depression=depression_map] [accumulation=accumulation_map] [max_slope_length=max_slope_length] [blocking=overland_blocking_map] [slope_steepness=slope_steepness_map] length_slope=length_slope_map [disturbed_land=rill_erosion_map] [slope_deposition=slope_deposition value or map]USAGE for ARMSED FILE creation: /usr/local/grass-7.0.svn/etc/r.watershed/ram [-4] elevation=elevation_map threshold=swale_threshold [flow=overland_flow_map] [drainage=drain_direction_map] [depression=depression_map] [accumulation=accumulation_map] [basin=watershed_basin_map] [stream=stream_segment_map] [half_basin=half_basin_map] ar=ARMSED_file_name WARNING: Subprocess failed with exit code 1
I am especially interested in a solution of problem 1 to get also a segment map as output of r.watershed.
Attachments (1)
Change History (5)
comment:1 by , 12 years ago
follow-up: 3 comment:2 by , 12 years ago
I just checked an the region matches:
| Type of Map: raster Number of Categories: 0 | | Data Type: DCELL | | Rows: 140 | | Columns: 190 | | Total Cells: 26600 | | Projection: UTM (zone 13) | | N: 4928000 S: 4914000 Res: 100 | | E: 609000 W: 590000 Res: 100 | | Range of data: min = 0 max = 16433.8095116624 | | | | Data Description: | | generated by r.cost
Two more important things: 1) The elevation input map is accutally already a thinned river raster. The raster values represent a pseude elevation which was generated with r.cost from the source. Thus the value (elevation) is increasing upstream. r.watershed is just used for getting the flowdirection and segmenting the river raster. (if needed I can provide the elevation-rcost raster)
2) I tried r.watershed with treshold=1 and that is working perfectly
And maybe a warning/error message should be printed when threshold = 0, instead of the (for me confusing error)
by , 12 years ago
Attachment: | distance_raster_test added |
---|
Example, River raster with pseudo-elevation (distance from mouth)
comment:3 by , 12 years ago
Replying to jradinger:
Two more important things: 1) The elevation input map is accutally already a thinned river raster. The raster values represent a pseude elevation which was generated with r.cost from the source. Thus the value (elevation) is increasing upstream. r.watershed is just used for getting the flowdirection and segmenting the river raster. (if needed I can provide the elevation-rcost raster)
r.watershed expects a surface as input. Using a thinned river raster as input should give weird results: all non-NULL cells face at least one NULL cell treated as unknown elevation, thus flow direction can not be unambiguously determined. You can try to place a buffer around the rivers and fill the buffer with pseudo-elevation values larger than the largest cost value. For example, create a buffer using 300 meter (3 cells) as distance, set a pseudo elevation value for the buffer zone, patch the thinned river raster with the pseudo elevation, run r.watershed with threshold=3. Works for me.
And maybe a warning/error message should be printed when threshold = 0, instead of the (for me confusing error)
Makes sense.
Markus M
comment:4 by , 9 years ago
Milestone: | → 6.4.6 |
---|
Does the region match the input raster? Can you post the complete output of
?
The threshold must be > 0. With a threshold of 2, the stream network would be very dense.
Markus M