Surface Contour (3D Analyst)

Summary

Creates contour lines derived from a terrain, TIN, or LAS dataset surface.

Learn more about how Surface Contour works

Illustration

TIN Contour illustration

Usage

  • The output feature class is 2D and contains an attribute with contour values.

  • Use the interval and base contour options to tailor the extent and resolution of the output feature class.

  • Use the out contour field data to convert the feature class to 3D.

  • In certain instances, the last valid contour line may not be produced when creating contours using TIN surfaces. This is an algorithmic limitation common to computer contouring software. To ensure that all valid contours are generated, add a very small negative value to the Base Contour field to slightly shift the data.

  • The Z factor parameter only affects results for rasters and TINs, not terrain datasets. When working with terrain datasets you can specify a contour interval that has the z factor built in to it. For example, if you want a one-foot contour interval and your terrain dataset surface is in meters, specify a contour interval of 0.3048. You can also convert the terrain dataset to a raster or TIN using either the Terrain To Raster or Terrain To TIN geoprocessing tools.

Parameters

LabelExplanationData Type
Input Surface

The TIN, terrain, or LAS dataset surface to process.

LAS Dataset Layer; Terrain Layer; TIN Layer
Output Feature Class

The feature class that will be produced.

Feature Class
Contour Interval

The interval between the contours.

Double
Base Contour
(Optional)

Defines the starting Z value from which the contour interval is either added or subtracted to delineate contours. The default value is 0.0.

Double
Contour Field
(Optional)

The field that stores the contour value associated with each line in the output feature class.

String
Contour Field Precision
(Optional)

The precision of the contour field. Zero specifies an integer, and the numbers 1–9 indicate how many decimal places the field will contain. By default, the field will be an integer (0).

Long
Index Interval
(Optional)

Index contours are commonly used as a cartographic aid for assisting in the visualization of contour lines. The index interval is typically five times larger than the contour interval. Use of this parameter adds an integer field defined by the Index Interval Field to the attribute table of the output feature class, where a value of 1 denotes the index contours.

Double
Index Interval Field
(Optional)

The name of the field used to identify index contours. This will only be used if the Index Interval is defined. By default, the field name is Index.

String
Z Factor
(Optional)

The factor by which z-values will be multiplied. This is typically used to convert z linear units to match x,y linear units. The default is 1, which leaves elevation values unchanged. This parameter is not available if the spatial reference of the input surface has a z datum with a specified linear unit.

Double
Pyramid Level Resolution
(Optional)

The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default is 0, or full resolution.

Double

arcpy.ddd.SurfaceContour(in_surface, out_feature_class, interval, {base_contour}, {contour_field}, {contour_field_precision}, {index_interval}, {index_interval_field}, {z_factor}, {pyramid_level_resolution})
NameExplanationData Type
in_surface

The TIN, terrain, or LAS dataset surface to process.

LAS Dataset Layer; Terrain Layer; TIN Layer
out_feature_class

The feature class that will be produced.

Feature Class
interval

The interval between the contours.

Double
base_contour
(Optional)

Defines the starting Z value from which the contour interval is either added or subtracted to delineate contours. The default value is 0.0.

Double
contour_field
(Optional)

The field that stores the contour value associated with each line in the output feature class.

String
contour_field_precision
(Optional)

The precision of the contour field. Zero specifies an integer, and the numbers 1–9 indicate how many decimal places the field will contain. By default, the field will be an integer (0).

Long
index_interval
(Optional)

Index contours are commonly used as a cartographic aid for assisting in the visualization of contour lines. The index interval is typically five times larger than the contour interval. Use of this parameter adds an integer field defined by the index_interval_field to the attribute table of the output feature class, where a value of 1 denotes the index contours.

Double
index_interval_field
(Optional)

The name of the field used to identify index contours. This will only be used if the index_interval is defined. By default, the field name is Index.

String
z_factor
(Optional)

The factor by which z-values will be multiplied. This is typically used to convert z linear units to match x,y linear units. The default is 1, which leaves elevation values unchanged. This parameter is not available if the spatial reference of the input surface has a z datum with a specified linear unit.

Double
pyramid_level_resolution
(Optional)

The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default is 0, or full resolution.

Double

Code sample

SurfaceContour example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window.

arcpy.env.workspace = "C:/data"
arcpy.ddd.SurfaceContour("sample.gdb/featuredataset/terrain", "contour.shp", 10)
SurfaceContour example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script.

'''****************************************************************************
Name: SurfaceContour Example
Description: This script demonstrates how to use the
             SurfaceContour tool.

****************************************************************************'''

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/data"

# Set Local Variables
inSurface = "sample.gdb/featuredataset/terrain"
outContour = arcpy.CreateUniqueName("contour.shp")

#Execute SurfaceContour
arcpy.ddd.SurfaceContour(inSurface, outContour, 10)

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics