Wednesday, June 29, 2011

Using r.buffer for watershed analysis

A problem that I ran into when using r.watershed with a masked basin was that the streams were being cut off, and the resulting basin was incorrect.

Close up of the HUC 10 watershed boundary in black and the streams derived from r.watershed in blue and pink


basin resulting from original mask


To solve this I created a buffer raster of the original raster being used as a mask.

r.buffer input=rioGrandeHUC10mask output=rioGrandeBuffer distances=100

Then, following the grass book

r.watershed -f elev_cm_rioGrande2 thresh=10000 accum=accum_10K drain=draindir_10K basin=basin_10K stream=rivers_10K --o
 
r.mapcalc "streams_der_30m=if(abs(accum_10K)>100,1,null())"

r.thin streams_der_30m out=streams_der_30m_tmp

r.to.vect -s streams_der_30m_tmp out=streams_der_30m

r.to.vect -s basin_10K out=basin_10K feature=area

Here is the resulting stream

Streams in green after using a buffer with 100m distance


r.water.outlet drainage=draindir_10K basin=outlet_O8 easting=170670 northing=270651 --o

r.mapcalc 'outlet_O8=if(outlet_O8==1,1,null())'


Resulting basin with buffered mask

No comments:

Post a Comment