Smooth Line (Cartography)


Smooths sharp angles in lines to improve aesthetic or cartographic quality.


Smooth Line illustration



SmoothLine_cartography (in_features, out_feature_class, algorithm, tolerance, {endpoint_option}, {error_option})
ParameterExplanationData Type

The line features to be smoothed.

Feature Layer

The output feature class to be created.

Feature Class

Specifies the smoothing algorithm.

  • PAEKAcronym for Polynomial Approximation with Exponential Kernel. It calculates a smoothed line that will not pass through the input line vertices. This is the default.
  • BEZIER_INTERPOLATIONFits Bezier curves between vertices. The resulting line passes through the vertices of the input line. This algorithm does not require a tolerance. Bezier curves will be approximated in shapefile output.

Sets a tolerance used by the PAEK algorithm. A tolerance must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit. You must enter a 0 as a placeholder when using the BEZIER_INTERPOLATION smoothing algorithm.

Linear unit

Specifies whether to preserve the endpoints for closed lines. This option works with the PAEK algorithm only.

  • FIXED_CLOSED_ENDPOINTPreserves the endpoint of a closed line. This is the default.
  • NO_FIXEDSmooths through the endpoint of a closed line.

Specifies how the topological errors (possibly introduced in the process, such as line crossing) will be handled.

  • NO_CHECKSpecifies not to check for topological errors. This is the default.
  • FLAG_ERRORSSpecifies to flag topological errors, if any are found.

Code Sample

SmoothLine Example (Python Window)

The following Python window script demonstrates how to use the SmoothLine tool in immediate mode.

import arcpy
from arcpy import env
import arcpy.cartography as CA
env.workspace = "C:/data"
CA.SmoothLine("contours.shp", "C:/output/output.gdb/smoothed_contours", "PAEK", 100)
SmoothLine Example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the SmoothLine tool.

# Name:
# Description: Simplify and then Smooth coastlines
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
import arcpy.cartography as CA
# Set environment settings
env.workspace = "C:/data/Portland.gdb/Hydrography"
# Set local variables
inCoastlineFeatures = "coastlines"
simplifiedFeatures = "C:/data/PortlandOutput.gdb/coastlines_simplified"
smoothedFeatures = "C:/data/PortlandOutput.gdb/coastlines_smoothed"

# Simplify coastlines.
CA.SimplifyLine(inCoastlineFeatures, simplifiedFeatures, "POINT_REMOVE", 50, "RESOLVE_ERRORS", "KEEP_COLLAPSED_POINTS", "CHECK")
# Smooth coastlines.
CA.SmoothLine(simplifiedFeatures, smoothedFeatures, "PAEK", 100, "FLAG_ERRORS")


Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes