[GRASS-user] r.fillnulls for large area

Hamish hamish_b at yahoo.com
Wed Nov 30 20:36:42 EST 2011

Nick wrote:
> I am having trouble filling the null areas in the SRTM (3 second
> resolution) DEM for Southeast Asia. I think the reason is because the
> region I am trying fill is too large. The region is almost a billion
> cells - see g.region -p output below - but about 40% of that region is
> ocean areas with no DEM data. I'm wondering if maybe the problem is that
> r.fillnulls is trying to fill the ocean areas. 

it will try that. a good first step is to fill in the ocean with 0s.
I was just doing this yesterday with srtm data actually.
GRASS> r.mapcalc "zero = 0"

then r.patch with your srtm data listed first and the zeros listed last.

but be careful you don't fill in zeros where there are holes in the data
on land. if you have a vector coastline use "v.to.rast use=val val=1" to
create a land mask, then invert with:
 r.mapcalc "sea.mask = if(isnull(land.mask), 1, null())"

and use the sea.mask as the background fill-in for the r.patch step.

> r.fillnulls gets to the point where it says "Building areas..." then
> it says "Killed" and prints an error message.

often "Killed" happens when the computer ran out of memory.
not interpolating over the ocean may make the thing go much faster and
need much less memory, as it has much less to do.

> I am using GRASS 6.4.1. Eventually I plan on using the null-filled
> DEM to delineate the watersheds in Southeast Asia. 

start thinking about your watershed threshold size now :)

good luck,

More information about the grass-user mailing list