This tool will convert a shapefile containing lines to a shapefile containing polygons. It does so by closing each of the line parts in the input file. Notice that this may not be appropriate for certain line files. Notice that this operation should not be confused with the Polygonize tool, which will identify the polygon features defining the enclosed spaces created by a set of intersecting lines.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.shp"
outputFile = wd + "output.shp"
args = [inputFile, outputFile]
pluginHost.runPlugin("LinesToPolygons", 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"
String[] args = [inputFile, outputFile]
pluginHost.runPlugin("LinesToPolygons", args, false)