Contour

Creates a vector contour coverage from a digital elevation model (DEM). The user must specify the name of a raster DEM file and the name of the output shapefile. The shapefile's attribute table will contain a field called 'ELEV' that will contain the elevation value for each contour feature. Contours will correspond with grid cell edges. As such, the contours in the output vector file will appear jagged, following pixel boundaries. If you require a more cartographically pleasing smoothed contour line (albeit less accurate), use the Smooth tool.

See Also:

Scripting:

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

wd = pluginHost.getWorkingDirectory()
demFile = wd + "DEM.dep"
outputFile = wd + "output.shp"
contourInterval = "50.0"
baseContour = "0.0"
zFactor = "1.0"
args = [demFile, outputFile, contourInterval, baseContour, zFactor]
pluginHost.runPlugin("Contour", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def demFile = wd + "DEM.dep"
def outputFile = wd + "output.shp"
def contourInterval = "50.0"
def baseContour = "0.0"
def zFactor = "1.0"
String[] args = [demFile, outputFile, contourInterval, baseContour, zFactor]
pluginHost.runPlugin("Contour", args, false)

Credits: