I have a global ocean pH raster map.The raster has large NoData areas: all land areas and many coastlines have NoData. The land areas should remain as NoData, but the ocean areas (blue) should be filled with pH values.
First I made a seperate map with all the ocean areas that need to be filled (black=1, white=NoData):
Then I tried to apply this method to fill the NoData gaps: https://support.esri.com/en/technical-article/000004792
I wrote the following line in the raster calculator:
Con("%pH_GapsToBeFillled%"==1, FocalStatistics("%pH_Global%", NbrRectangle(10,10, "CELL"), "MEAN"), "%pH_Global%")
However, I keep getting the following error. Does anyone know where the problem occurs?
Hi,
Let's try this code:
Con("%pH_GapsToBeFillled%"==1, FocalStatistics("%pH_Global%", NbrRectangle(10,10, "CELL"), "MEAN",""), "%pH_Global%")
I added a ("") at the end of FocalStatistics function to set "Not ignore NoData". Also, you may want to set your workplace by arcpy.workspace function.
I hope this helps.