[GRASS-user] Re: how to only fill small sinks with r.fill.dir

Bryan Keith bkeith at itascadenver.com
Tue Apr 26 16:33:58 EDT 2011


On Tue, Apr 26, 2011 at 12:51, Saber Razmjooei
<razmjooeis at faunalia.co.uk> wrote:
> You probably need a full 2D hydraulic model to do work based on water
> level gradient.
> Maybe something like like ANUGA:
> http://sourceforge.net/projects/anuga/

This seems like an overkill.

What I want is to do be able to put particles on a 2d field and
generate smooth (not 8-directional) flow paths.  I also have the
cavaet of not having perfect input data.  I have a surface that has
small sinks that need to be removed but has large sinks that are valid
data.

r.flow gets very close to what I want.  Actually I think r.flow would
do exactly what I want if my input sinks were filled and pointed
toward the new outlet (something that doesn't happen when they're
filled manually).

With the manual sink filling or r.watershed or r.drain, I'm still not
much closer than the original r.flow output.

Bryan

>
>
>
> On Tue, 2011-04-26 at 11:54 -0600, Bryan Keith wrote:
>> Great ideas, thank you. I did something like this:
>>
>> r.fill.dir input=wl200310_krig_g elevation=wl200310_fill_g
>> direction=wl200310_dir_g
>> r.mapcalc wl200310diff_g=wl200310_fill_g - wl200310_krig_g
>>
>> r.mapcalc wl200310diffsel_g = if("wl200310diff_g > 5.0", 0, wl200310diff_g)
>> r.mapcalc wl200310sel_g = wl200310diffsel_g + wl200310_krig_g
>> r.fill.dir input=wl200310sel_g elevation=wl200310sel_fill_g
>> direction=wl200310sel_dir_g
>>
>> r.flow elevin=wl200310sel_fill_g flout=test_ln
>>
>> I think my problem is now with r.flow.  I would like to see flows
>> continue through the filled sink and out the other end (as if it were
>> a lake), but that doesn't happen.  I don't think it can happen with
>> r.flow because r.flow encounters a flat area.
>>
>> Not sure what to try next.  This was a problem even before messing
>> around with the sink tolerance.
>>
>> Bryan
>>
>> On Tue, Apr 26, 2011 at 10:31, Saber <razmjooeis at faunalia.co.uk> wrote:
>> > Sorry...I thought the sinks are as null values.
>> > Ignore my previous email.
>> > I can't think of anything apart from improving your DEM to get rid of the
>> > artifacts.
>> > One way will be to get the initial result from the r.fill.dir. Identify
>> > the areas where the depth is more than say 10 metre (r.nulls
>> > map=initial_result setnull 0-9.99)
>> >
>> > You can then add the new depth raster to the DEM to create the "filled
>> > hole". (first r.mask to match initial_result and then r.mapcalc
>> > filled_holes=initial_result+DEM)
>> > Then remove the mast and r.patch
>> > r.patch input=filled_holes,DEM output=patched_DEM
>> >
>> > You can then use the patched_DEM for r.fill.dir
>> >
>> > Hope that helps.
>> >
>> >
>> >
>> >> Hmmm, I'm not following all your steps, but I don't want to manually
>> >> identify valid sinks vs. invalid sinks.  I have quite a lot of
>> >> surfaces to process, and I'm happy to fill all sinks except those
>> >> deeper than 10m.
>> >>
>> >> On Tue, Apr 26, 2011 at 10:04, Saber <razmjooeis at faunalia.co.uk> wrote:
>> >>> Here is a (not a very quick) solution I can think of:
>> >>>
>> >>> 1- Create an inverse mask
>> >>> 2- convert the mask to vector (r.to.vect)
>> >>> 3- clean the vector file to get rid of the areas not required (v.clean)
>> >>> 4- convert the vector back to raster (v.to.rast)
>> >>> 5- Use the new raster as a mask for filling holes (probably you need
>> >>> step
>> >>> 4.5 to slightly buffer the raster)
>> >>>
>> >>> Hope that helps
>> >>>
>> >>>
>> >>>> Any ideas on this?
>> >>>>
>> >>>> Bryan
>> >>>>
>> >>>> On Mon, Apr 18, 2011 at 14:49, Bryan Keith <bkeith at itascadenver.com>
>> >>>> wrote:
>> >>>>> Hello,
>> >>>>>
>> >>>>> Is there a way to only fill sinks in a DEM if they are smaller than a
>> >>>>> certain tolerance?  I have a couple areas of internal drainage that
>> >>>>> really are correct (and quite large), and I have a quite few small
>> >>>>> sinks that are incorrect and artifacts of the interpolation.  Any
>> >>>>> ideas how to this?  r.fill.dir attempt to fill all the sinks.
>> >>>>>
>> >>>>> I'm trying to improve the results from r.flow  Too many tracks end in
>> >>>>> small holes where I'd like them to continue downstream.  Thanks.
>> >>>>>
>> >>>>> Bryan
>> >>>>>
>> >>>> _______________________________________________
>> >>>> grass-user mailing list
>> >>>> grass-user at lists.osgeo.org
>> >>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>
>> >
>> >
>> >
>
>
>


More information about the grass-user mailing list