Clip

The Clip tool will extract all the features, or parts of features, that overlap with the features of the Clip vector file. The clipping operation is one of the most common vector overlay operations in GIS and effectively imposes the boundary of the clip layer on a set of input vector features, or target features. The operation is sometimes likened to a 'cookie-cutter'. The input vector file can be of any feature type (i.e. points, lines, polygons), however, the Clip vector must consist of polygons. This tool operates in parallel and will experience significantly faster processing when run using a system with a multi-core processor.


See Also:

Scripting:

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

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.shp"
clipFile = wd + "clip.shp"
outputFile = wd + "output.shp"
args = [inputFile, clipFile, outputFile]
pluginHost.runPlugin("Clip", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.shp"
def clipFile = wd + "clip.shp"
def outputFile = wd + "output.shp"
String[] args = [inputFile, clipFile, outputFile]
pluginHost.runPlugin("Clip", args, false)


Credits: