Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to run the majority filter in ArcGIS with a window size of 4 or 5 i.e. greater than the default 3. Is it possible? Or some other command (or tool) which might help me achieve that?

thanks!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

A Focal Majority function does a very poor job at establishing a MMU. I would recommend using a sieve approach. This will provide an exact defined MMU.

I believe that GDAL has a sieve model and it is also available in our Gradient Metrics ArcGIS Toolbox. It is an easy procedure to implement. The ArcGIS steps for using sieve to establish a minimal mapping unit of 10 cells are, more or less, as follows:

MinCells = 10
tmp1 = RegionGroup(InRaster, "EIGHT", "WITHIN", "ADD_LINK", "") 
  query = "VALUE > " + minCells
tmp2 = ExtractByAttributes(tmp1, query)
outraster = Nibble(InRaster, tmp2)
share|improve this answer
    
Thanks Jeffrey, I will test out both approaches (Focal Vs Gradient Metrics toolkit) and check out the differences in my area. –  user1186 Mar 7 '13 at 17:55
    
You were right, the sieve tool provides much better results! Thanks for the excellent toolkit. Just one query, the 'minimum cells in mapping unit' parameter in the sieve tool defines the height/width of a square window, right? –  user1186 Mar 25 '13 at 7:31
add comment

Try using the Focal Statistics tool with a Majority rule. It allows you to set a variety of window shapes, sizes, etc.

share|improve this answer
1  
Focal Statistics is quite universal - for example I needed the same as user1186 (larger kernel size than 3x3) and Focal Statistics with Mean rule was perfect. +1 –  Pavel Mar 7 '13 at 14:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.