This tool creates a new blank shapefile. The user must specify the name of the output file and the shapefile type (e.g. point, polyline, polygon, etc.). Upon completion, the newly created shapefile will be added to the displayed and the 'Edit Vector' tool will be selected. Attributes can be added to the blank shapefile at this point by opening the attributes table ('Add New Field').
CreateNewShapefile is a necessary tool for any operation requiring on-screen digitizing, including Watershed extraction, Viewshed mapping, and Image Rectification, among others.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
outputFile = wd + "output.shp"
shapeType = "Point"
args = [outputFile, shapeType]
pluginHost.runPlugin("CreateNewShapefile", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def outputFile = wd + "output.shp"
def shapeType = "Polygon"
String args = [outputFile, shapeType]
pluginHost.runPlugin("CreateNewShapefile", args, false)