I am trying to get rid of some small gaps of no data in my rasters. I would previously have used focalmean but it is no longer available. I've tried what I expected to work but I'm getting errors.

What I have is:

MYNEWRAST = Con(IsNull("rasterrast"),FocalStatistics("rasterrast",NbrRectangle(50,50),"MEAN","NODATA"),"rasterrast")

and this is giving me a pretty unhelpful error message:

Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 5142, in FocalStatistics     ignore_nodata)   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Utils.py", line 47, in swapper     result = wrapper(*args, **kwargs)   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\sa\Functions.py", line 5136, in Wrapper     ignore_nodata)   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>     return lambda *args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 999999: Error executing function. General function failure [FocalSt_rast6] Failed to execute (FocalStatistics). 

Has anyone had something similar working, and did they do it differently?

enter image description here

  • Try this:Con(IsNull("rasterrast "), FocalStatistics("rasterrast ", NbrRectangle(50, 50, "CELL"), "MEAN"), " rasterrast ") – Albert Sep 3 '15 at 11:06
  • I've tried it, and no luck there – whatahitson Sep 3 '15 at 11:59
  • It works for me. Can you add a screen of the raster calculator window? – Albert Sep 3 '15 at 12:02
  • 1
    Yes, well...I asked you to post a screen because I wanted to see what output you were trying to create but it is cut, and I can't see it, hehe. I think the problem may be there. – Albert Sep 3 '15 at 12:34
  • 1
    It seems that you were on the right track - saving outside a fgdb seems to work – whatahitson Sep 3 '15 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.