This tool smooths a vector coverage of either a polyline or polygon base shape type. The algorithm uses a simple moving average method for smoothing, where the size of the averaging window is specified by the user. The default value is 3 and can be any odd integer larger than or equal to 3. The larger the averaging window, the greater the degree of line smoothing.
Smooth is useful for post-processing the outputs of the Contour tool and the Raster To Vector Polygons tool.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "lines.shp"
outputFile = wd + "output.shp"
filterSize = "10"
args = [inputFile, outputFile, filterSize]
pluginHost.runPlugin("Smooth", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "polygons.shp"
def outputFile = wd + "output.shp"
def filterSize = "10"
String args = [inputFile, outputFile, filterSize]
pluginHost.runPlugin("Smooth", args, false)