Sunday 25 March 2018

raster - Majority filter (minimum mapping unit) in ArcGIS Desktop with larger window size?


I want to run the majority filter in ArcGIS Desktop with a window size of 4 or 5 i.e. greater than the default 3.


Is it possible, or is there some other command (or tool) which might help me achieve that?




Answer



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)

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...