Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] r.traveltime does not give same results as r.watershed #788

Open
plvoit opened this issue Aug 31, 2022 · 2 comments
Open

[Bug] r.traveltime does not give same results as r.watershed #788

plvoit opened this issue Aug 31, 2022 · 2 comments

Comments

@plvoit
Copy link

plvoit commented Aug 31, 2022

Name of the addon
r.traveltime

Describe the bug
When using r.traveltime one would expect that every pixel in subbasin, created with r.watershed, flows to the outlet point, which is defined by the cell with the maximum flow accumulation value within the respective subbasin. Unfortunately this does not always work and the resulting traveltime-raster is often smaller than the the subbasin (see attached screenshot where the yellow part is not included in the traveltime rarster). What is the reason that some cells apparently never arrive at the outlet, although r.traveltime and r.watershed use the same input grids (filled DEM (r.fill.dir), flow direction and flow accumulation)?

To Reproduce
Steps to reproduce the behavior:

  1. Open the North Carolina dataset nc_basinc_spm_grass7
  2. Run following commands in the console (the outlet coordinates where derived manually):

g.region raster=elevation@PERMANENT
r.fill.dir --overwrite input=elevation@PERMANENT output=filled_dem direction=flowdir format=agnps
r.fill.dir --overwrite input=filled_dem@PERMANENT output=filled_dem2 direction=flowdir2 format=agnps
r.watershed -s -a --overwrite elevation=filled_dem2@PERMANENT accumulation=accu basin=subbasins threshold=10000
r.mapcalc "n = 0.035f" --overwrite
r.traveltime --overwrite dir=flowdir2@PERMANENT accu=accu@PERMANENT dtm=filled_dem2@PERMANENT manningsn=n@PERMANENT out_x=637757.00 out_y=218794.34 threshold=3000 b=1 nchannel=0.03 dis=1000 out=traveltime_99

Expected behavior
In a subbasin created with r.watershed every cell should eventually flow to the outlet and the traveltime raster, created with r.traveltime, should have the same size as the subbasin.

Screenshots
Screenshot is attached

System description (please complete the following information):

  • Operating System: Linux Ubuntu 20.4
  • GRASS GIS version 7.8.6

screenshot

@plvoit
Copy link
Author

plvoit commented Aug 31, 2022

I found the problem. It seems as long as there are unresovled areas with r.fill.dir, r.traveltime might not perform correctly. I now ran r.fill.dir 5 times instead of two times and r.traveltime performed correctly. Sorry for the hassle, I actually was dealing with that since quite a while until I wrote the bug report and found the solution 5 min after that....

@ecodiv
Copy link
Contributor

ecodiv commented Sep 7, 2022

Good to hear you found the solution. If solved, perhaps good to close the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants