AnsweredAssumed Answered

Is there a way to increase the search radius of nearest neighbors for the Nibble tool

Question asked by mmallek on Mar 12, 2013
Latest reply on Mar 13, 2013 by mmallek
I am working with a raster map vegetation types. I have about 20 types with unique raster code values that can be sorted into three classes:

1 - vegetation types I want to expand using the nibble function (e.g. forest)

2 - vegetation types I consider static that I do not want to either nibble or be nibbled (e.g. water, developed areas)

3 - vegetation types that I want to eliminate through the nibble function (early seral stages, such as grass and chaparral)

The first time I ran this I was under a deadline and didn't have time to figure out a better solution, and wasn't able to find one googling/searching. I'm hoping to find a way to make this a shorter geoprocessing slog.

As inputs to the Nibble, I reclassified my veg layer so that the type 2 (static) values were nodata, since I didn't want them to nibble. That was my input layer. For the input MASK, I reclassified the original raster but made the type 3 values nodata, since they are the ones I want to eliminate through nibbling.

The catch is that I tend to have large amounts of type 3 clustered together, and on top of that there are several places where the type 2 and type 3 values are clustered near each other. The upshot is that the nibble gave me an incomplete output. It ran correctly, as far as I could tell, but it would stop before nibbling away all of the masked values.

I think the problem is that the nibble function has some predetermined search radius for the nearest neighbor, and if a cell is surrounded by type 2 and 3 cells then it can be so far away from a type 1 cell that the nibble doesn't reach it. However, looking into the tools, the whole Nibble tool is just one function that is called with those two inputs, so I can't modify the python code to change the search radius. I am not skilled enough in python to write a loop that would run the nibble over and over again.

So, is there a way to get the Nibble to fill in more of the masked values at a time? Is there a place I can get the Nibble code to try and modify it? I would imagine at some point a distance threshold was specified.

Thanks in advance!