> 
> 	I am using hyperclustered TM imagery to map deciduous
>  forests in New England as part of the GAP Analysis program.  
> This treatment produces a large number of spectral classes which
>  we then reclass into our vegetation types with "i.infer".  I  found 
> that quantifying neighborhood associations increased our accuracy 
>  and have used "r.neighbors" to identify the most frequently 
> occurring spectral class around each pixel.  However, I need a 
> way to identify the second and third most frequent neighbors as 
> well and produce percentages of each if possible.  I have tried to do 
> this in the MIPS sml language without much luck, being among 
> the programmably challenged, and would prefer to use GRASS 
> because it's in the public domain.
> 
> 	Could any of you help with a modification of "r.neighbors",
>  either with multilayer output or as a set of programs applied in 
> sequence.  Not only would you receive the undying gratitude of my 
> department, co-authors and self, but your efforts would be fully 
> credited in any subsequent publication.
> 
> Dana Slaymaker
> Department of Forestry and Wildlife Management
> University of Massachusetts in Amherst
> dana@fnr.umass.edu
> (413) 545-4853
> 
> 	
> 


What about using r.mapcalc?  It has neighbor capabilities and 
temporary variables.  You could create a *very* nested if statement
keeping track of whether any neighbor cell equals any other neighbor
cell (marching around the center), incrementing tallying variables
as appropriate.  Then set the value of the center cell to that of
the 2nd or 3rd largest tally.

If you don't have it there are good r.mapcalc tutorials showing
these capabilities.


---------------------------------------------------------------------

 Susan Huse         /\       http://www.regis.berkeley.edu/sue
              /\   /  \  /\      
 REGIS       /  \ /    \/  \ /\    sue@ced.berkeley.edu/sue
          /\/    \      \   /  \ /\ 
 University of California  /    /  \ (510) 643-6307
   Berkeley        \      /         \ 
       /            \                \ 
      /                               \ 
 

