I tried this and it gave unsatisfactory results.  I used the default
settings.  I don't remember exactly why the results were
unsatisfactory, but I will check when I get home.  This will be in
about thirty minutes.
regards,

Stephen Sefick

On Fri, Aug 28, 2009 at 4:33 PM, achim<[email protected]> wrote:
> what about setting all zero-values to NULL
> (r.mapcalc "nullmap=(if (map==0,null(),map)")
> and then running r.fillnulls?
> (http://grass.itc.it/grass64/manuals/html64_user/r.fillnulls.html)
>
> A.
>
> stephen sefick schrieb:
>> only the no zero values.  I could probably do something like if
>> patch_benning[-1,-1]>0 etc., but I don not know how to code the number
>> of non-zero numbers in the divisor to get and average.  Thanks for all
>> of the help.
>>
>> Stephen Sefick
>>
>> On Fri, Aug 28, 2009 at 1:44 PM, Glynn Clements<[email protected]> 
>> wrote:
>>> stephen sefick wrote:
>>>
>>>> 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,
>>> Do you want the average of all of the surrounding values, or only the
>>> non-zero values?
>>>
>>> If you replace the zeros with nulls, you can use r.neighbors and
>>> r.patch.
>>>
>>> --
>>> Glynn Clements <[email protected]>
>>>
>>
>>
>>
>



-- 
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

Reply via email to