[GRASS5] Re: [GRASSLIST:8746] Re: r.fillnulls and res < 1

Hamish hamish_nospam at yahoo.com
Mon Oct 24 21:11:33 EDT 2005


Robert:
> > I am having trouble with r.fillnulls and a raster having a
> > resolution of 0.48.
> > 
> > Is it right that r.fillnulls only works for raster with a resolution
> > 1?

Markus:
> thanks for finding the problem. I have fixed it in 6.1-CVS and
> 6.0-CVS (for future 6.0.2).
..
> Now resolution of 0.48 are accepted as well.


Hey Markus,

-RES="`expr $nsres_int + $ewres_int`"  # avg*2
+RES="`echo $nsres_int $ewres_int | awk '{printf "%f\n", ($1+$2) / 2.}'`"


the buffer around the holes was twice the resolution on purpose. With 
nominally two points around the edge you interpolate into the hole with 
a trained slope at the edges, otherwise you just get a flat plane.

Perhaps that should even be three times the mean resolution to give
three points in all directions to define both the incoming slope &
curvature. It shouldn't affect processing time any and hopefully would
give a more realistic guess of what is in the hole. Maybe even a bigger
buffer?

With just a single row of cells around the hole you often get gaps
around the edges when distance > mean (.5 of the time? diagonals? worse 
when ewres!=nsres).


also,
nsres_int="`g.region -gm | grep 'nsres=' | sed s/nsres=//`"
ewres_int="`g.region -gm | grep 'ewres=' | sed s/ewres=//`"

could probably be reduced to:
eval `g.region -gm`



Hamish




More information about the grass-dev mailing list