Union

This tool can be used to join the features, or parts of features, in two input vectors. Union is the vector equivalent to the Boolean operator OR used for raster overlay. Importantly, the Union tool will remove all interior boundaries when combining features. If there is a need to preserve interior boundaries between features, you should use the Fuse instead. Therefore, the Fuse is more similar to ArcGIS's Union tool.

See Also:

Scripting:

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

wd = pluginHost.getWorkingDirectory()
# You may have multiple input shapefiles but they must
# be separated by semicolons in the string.
inputFiles = wd + "input1.shp" + ";" + wd + "input2.shp" + ";" + wd + "input3.shp"
outputFile = wd + "tmp1.shp"
args = [inputFiles, outputFile]
pluginHost.runPlugin("Append", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
// You may have multiple input shapefiles but they must
// be separated by semicolons in the string.
def inputFiles = wd + "input1.shp" + ";" + wd + "input2.shp + ";" + wd + "input3.shp""
def outputFile = wd + "tmp1.shp"
String[] args = [inputFiles, outputFile]
pluginHost.runPlugin("Append", args, false)

Credits: