[GRASS5] Fill NULL holes in raster maps

Markus Neteler neteler at geog.uni-hannover.de
Tue Jan 16 14:04:15 EST 2001


Hi Bob,

On Tue, Jan 16, 2001 at 09:52:34AM -0400, Bob Covill wrote:
[...]
> On another issue, I believe you asked yesterday about filling data holes
> in raster files. The current procedure that I use is to create a temporary
> raster with r.neighbors ...
> 
> r.neighbors input=orig.rast output=tmp.rast method=average size=3
> 
> I then take the 3x3 filled tmp rast and combine it with the original ...
> 
> r.mapcalc >  orig.rast.fill = if ( isnull(orig.rast), tmp.rast, orig.rast)
> 
> This procedure can then be repeated on the filled raster. It would be nice
> if a single program combined the above procedures.
> 
> My question is whether r.neighbors is the ideal program to use? Right now
> I have to run r.null on the above tmp.rast if the original raster had
> nulls. r.neighbors outputs zeros, not nulls. Is it worth modifying
> r.neighbors to output nulls if the input conatins nulls, or is there a
> better way to do it (ie. r.mapcalc)?
> 
> Thanks in advance for any input.
> --
> Bob Covill

>From yesterday's discussion I feel that r.mapcalc might be easier to use
than r.neighbor and r.mapcalc (you could use both the 3x3 operation and the
replacement in an eval() environment, just an idea).
However, to have a standalone module would be the best as
scripts are usually very slow. And a 3x3 won't be sufficient in most cases
so you need to run it again and again...

But maybe the r.neighbors code could be modified to do the job?

Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list