This does not quite work for my purposes. The problem is the the 0 values are in a 2 or 3 grid wide seam in between patched raster maps, so the value is lower than it should be using
r.mapcalc "benning_dem=if(patch_benning==0, (patch_benning[-1,-1]+patch_benning[1,-1]+patch_benning[-1,0]+ patch_benning[1,0]+patch_benning[-1,1]+patch_benning[1,1])/6, patch_benning)" any thoughts, Stephen Sefick On Fri, Aug 28, 2009 at 12:08 PM, Milton Cezar Ribeiro<[email protected]> wrote: > Hi stephen, > > just to remember not include yourmap[0,0] > bests > milton > 2009/8/28 stephen sefick <[email protected]> >> >> I think so- let me try it >> >> On Fri, Aug 28, 2009 at 12:04 PM, achim<[email protected]> >> wrote: >> > 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 >> >> >> > >> >> >> >> -- >> Stephen Sefick >> >> Let's not spend our time and resources thinking about things that are >> so little or so large that all they really do for us is puff us up and >> make us feel like gods. We are mammals, and have not exhausted the >> annoying little problems of being mammals. >> >> -K. Mullis >> _______________________________________________ >> grass-user mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/grass-user > > -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
