Vector cleaning

This tool can be used to correct the topology of a shapefile such that shared boundaries between neighbouring polygon features are correctly represented. This is achieved through making very small adjustments in node positions such that nodes that are nearer than the user-specified distance tolerance are snapped together. Sliver polygons are thereby removed. This can be an important procedure before carrying out a number of vector analysis operations including Dissolve.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.shp"
outputFile = wd + "output.shp"
tolerance = "0.01"
args = [inputFile, outputFile, tolerance]
pluginHost.runPlugin("VectorCleaning", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.shp"
def outputFile = wd + "output.shp"
def tolerance = "0.01"
String[] args = [inputFile, outputFile, tolerance]
pluginHost.runPlugin("VectorCleaning", args, false)

Credits: