This tool can be used to fill in small gaps in an image or digital elevation model (DEM). The gaps, or holes, must have NoData values (-32,768). If gaps do not currently have this characteristic, use the Set NoData Value tool. All valid, non-NoData values in the input image will be assigned the same value in the output image.
The user must specify the names of the input and output raster images as well as the maximum cross-section length. This distance, in grid cells, is used to determine how far the algorithm will search for valid, non-NoData values. The algorithm will search to a maximum of half this distance in each of the north, south, east, and west directions along N-S and E-W cross-sections. The valid end-point values and lengths of these two cross-sections are then used to linearly interpolate the new value. If only one of the two cross-sections were identified to have valid end-point values, then the estimation will be based on a single cross-section. If neither cross-section is created, the grid cell will be assigned the NoData value in the output image. Therefore, setting a larger maximum cross-section length allows for the filling of larger gaps in the input image. There is generally no issue with setting this parameter to a high value, since the algorithm will stop looking for a valid-valued end-point once one has been found in a particular direction, though this may make the tool operate slowly for some images.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.dep"
outputFile = wd + "output.dep"
args = [inputFile, outputFile]
pluginHost.runPlugin("FillMissingDataHoles", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.dep"
def outputFile = wd + "output.dep"
String args = [inputFile, outputFile]
pluginHost.runPlugin("FillMissingDataHoles", args, false)