r.mapcalc "newmap = if ( yourmap==0 , ( sum( yourmap[-1,1] ,
yourmap[0,1] , ...)/8 ) , yourmap)"

is that what you mean?

stephen sefick schrieb:
> if(0, (sum([-1,1], [0, 1], [1,1], [-1,0], [0,0], [1,0],[-1,-1],
> [0,-1],[1,-1])/8))
> 
> I want to use mapcalc to do the above.  I am missing a syntax step.
> if a value is zero take the average of the eight nearest neighbors and
> replace the value with this.  Otherwise, keep the value unchanged
> 
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to