Simplify Line (Cartography)

Summary

Simplifies lines by removing relatively extraneous vertices while preserving essential shape.

Illustration

Simplify Line tool algorithm option examples
Sample results from the simplification algorithms are shown here for comparison.

Usage

  • This tool uses different simplification algorithms for different purposes. To learn more about these algorithms, see How Simplify Line and Simplify Polygon work.

    • Retain critical points (Douglas-Peucker) algorithm (algorithm = "POINT_REMOVE" in Python)—Identifies and removes relatively redundant vertices to simplify data for display at smaller scales. It is the fastest of the simplification algorithms in this tool. This algorithm is often used for data compression or for coarse simplification. The angularity of the resulting lines increase significantly as the tolerance increases. This algorithm is based on the Douglas-Peucker algorithm: Douglas, David and Peucker, Thomas, "Algorithms for the reduction of the number of points required to represent a digitized line or its caricature," The Canadian Cartographer 10(2), 112–122 (1973).
    • Retain critical bends (Wang-Müller) algorithm (algorithm = "BEND_SIMPLIFY" in Python)—Identifies and eliminates relatively insignificant bends to simplify data for display at smaller scales. It is typically more accurate regarding the input geometry than the Retain critical points (Douglas-Peucker) algorithm but can take more time to process. This algorithm is based on the algorithm defined in Wang, Zeshen and Müller, Jean-Claude, "Line Generalization Based on Analysis of Shape Characteristics," Cartography and Geographic Information Systems 25(1), 3–15 (1998).
    • Retain weighted effective areas (Zhou-Jones) algorithm (algorithm = "WEIGHTED_AREA" in Python)—Identifies triangles of effective area for each vertex. These triangles are then weighted by a set of metrics to compare the flatness, skewness, and convexity of each area. The weighted areas guide the removal of their corresponding vertices to simplify the line while retaining as much character as possible. This algorithm is based on the algorithm defined in Zhou, Sheng and Jones, Christopher B., "Shape-Aware Line Generalisation with Weighted Effective Area," in Fisher, Peter F. (Ed.), Developments in Spatial Handling: 11th International Symposium on Spatial Handling, 369–80 (2005).
    • Retain effective areas (Visvalingam-Whyatt) algorithm (algorithm = "EFFECTIVE_AREA" in Python)—Identifies triangles of effective area for each vertex to guide the removal of vertices to simplify the line while retaining as much character as possible. This algorithm is based on the algorithm defined in Visvalingam, M. and Whyatt, J. D., "Line Generalisation by Repeated Elimination of the Smallest Area," Cartographic Information Systems Research Group (CISRG) Discussion Paper 10, The University of Hull (1992).

  • The Simplification Tolerance parameter value determines the degree of simplification. The larger the tolerance, the more coarse the resulting geometry. Smaller tolerances generate geometry that more accurately represents the input. The MinSimpTol and MaxSimpTol fields are both added to the output to store the tolerance that was used.

    Legacy:

    In the course of topology resolution, versions of the tool prior to ArcGIS Pro 1.4 modified tolerance on a per-feature basis and stored those values in the MinSimpTol and MaxSimpTol fields. Now the values in these fields will be the same and equal to the tolerance specified in the Simplification Tolerance parameter. Be sure to modify existing models and scripts that rely on any of these fields.

    • For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.
    • For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.
    • For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.
    • For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.

  • Use the Keep collapsed points parameter (collapsed_point_option in Python) to create an output point feature class to store the endpoints of any lines that are smaller than the spatial tolerance of the data. The point output is derived; it will use the same name and location as the Output feature class parameter value (out_feature_class in Python) but with a _Pnt suffix. The output line feature class contains all the fields present in the input feature class. The output point feature class does not contain any of these fields.

  • The output line feature class is topologically correct. Any topological errors in the input data are flagged in the output line feature class. The output feature class includes two additional fields, InLine_FID and SimLnFlag, that contain the input feature IDs and topological errors of the input, respectively. A SimLnFlag value of 1 indicates that a topological error is present; a value of 0 (zero) indicates that no errors are present.

    Legacy:

    Prior to the ArcGIS Pro 1.4 version of this tool, topological errors could be generated during processing. The Check for topological errors (error_checking_option in Python) and the Resolve topological errors (error_resolving_option in Python) parameters were included to identify and optionally resolve these errors. These parameters are still included in the tool's syntax for compatibility in scripts and models but are now ignored and are hidden from the tool's dialog box. The SimLnFlag field was used to flag topological errors introduced by the tool in processing. This field now flags errors present in the input.

  • Use the Input barrier layers parameter to identify features that must not be crossed by simplified lines. Barrier features can be points, lines, or polygons.

  • Domains and subtypes are copied to the output even if the Transfer field domain, subtypes, and attributes rules environment is unchecked.

  • Processing large datasets may exceed memory limitations. In such cases, consider processing input data by partition by identifying a relevant polygon feature class in the Cartographic Partitions environment setting. Portions of the data, defined by partition boundaries, will be processed sequentially. The resulting feature class will be seamless and consistent at partition edges. See Generalizing large datasets using partitions for more information.

Parameters

LabelExplanationData Type
Input Features

The input line features to be simplified.

Feature Layer
Output Feature Class

The simplified output line feature class. It contains all fields present in the input feature class. The output line feature class is topologically correct. The tool does not introduce topology errors, but topological errors in the input data are flagged in the output line feature class. The output feature class includes two additional fields, InLine_FID and SimLnFlag, to contain the input feature IDs and the input topological errors, respectively. A SimLnFlag value of 1 indicates that an input topological error is present; a value of 0 (zero) indicates that no input error is present.

Feature Class
Simplification Algorithm

Specifies the line simplification algorithm.

  • Retain critical points (Douglas-Peucker) — Critical points that preserve the essential shape of a line are retained, and all other points are removed (Douglas-Peucker).This is the default.
  • Retain critical bends (Wang-Müller) — Critical bends are retained, and extraneous bends are removed from a line (Wang-Müller).
  • Retain weighted effective areas (Zhou-Jones) —Vertices that form triangles of effective area that have been weighted by triangle shape are retained (Zhou-Jones).
  • Retain effective areas (Visvalingam-Whyatt) —Vertices that form triangles of effective area are retained (Visvalingam-Whyatt).
String
Simplification Tolerance

The tolerance determines the degree of simplification. You can choose a preferred unit; otherwise, units of the input will be used. The MinSimpTol and MaxSimpTol fields are added to the output to store the tolerance that was used when processing occurred.

  • For the Retain critical points (Douglas-Peucker) algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.
  • For the Retain critical bends (Wang-Müller) algorithm, the tolerance is the diameter of a circle that approximates a significant bend.
  • For the Retain weighted effective areas (Zhou-Jones) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.
  • For the Retain effective areas (Visvalingam-Whyatt) algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.
Linear Unit
Resolve topological errors
(Optional)
Legacy:

This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were resolved. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.

Boolean
Keep collapsed points
(Optional)

Specifies whether an output point feature class will be created to store the endpoints of any lines that are smaller than the spatial tolerance. The point output is derived; it will use the same name and location as the Output feature class parameter but with a _Pnt suffix.

  • Checked—A derived output point feature class will be created to store the endpoints of collapsed zero length lines. This is the default.
  • Unchecked—A derived output point feature class will not be created.
Boolean
Check for topological errors
(Optional)
Note:

This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were handled. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.

Boolean
Input Barrier Layers
(Optional)

Inputs containing features to act as barriers for simplification. Resulting simplified lines will not touch or cross barrier features. For example, when simplifying contour lines, spot height features input as barriers ensure that the simplified contour lines will not simplify across these points. The output will not violate the elevation as described by measured spot heights.

Feature Layer

Derived Output

LabelExplanationData Type
Lines Collapsed To Zero Length

When the Keep collapsed points parameter (collapsed_point_option in Python) is used, an output point feature class is created to store the endpoints of any lines that are smaller than the spatial tolerance of the data.

Feature Class

arcpy.cartography.SimplifyLine(in_features, out_feature_class, algorithm, tolerance, {error_resolving_option}, {collapsed_point_option}, {error_checking_option}, {in_barriers})
NameExplanationData Type
in_features

The input line features to be simplified.

Feature Layer
out_feature_class

The simplified output line feature class. It contains all fields present in the input feature class. The output line feature class is topologically correct. The tool does not introduce topology errors, but topological errors in the input data are flagged in the output line feature class. The output feature class includes two additional fields, InLine_FID and SimLnFlag, to contain the input feature IDs and the input topological errors, respectively. A SimLnFlag value of 1 indicates that an input topological error is present; a value of 0 (zero) indicates that no input error is present.

Feature Class
algorithm

Specifies the line simplification algorithm.

  • POINT_REMOVECritical points that preserve the essential shape of a line are retained, and all other points are removed (Douglas-Peucker).This is the default.
  • BEND_SIMPLIFYCritical bends are retained, and extraneous bends are removed from a line (Wang-Müller).
  • WEIGHTED_AREAVertices that form triangles of effective area that have been weighted by triangle shape are retained (Zhou-Jones).
  • EFFECTIVE_AREAVertices that form triangles of effective area are retained (Visvalingam-Whyatt).
String
tolerance

The tolerance determines the degree of simplification. You can choose a preferred unit; otherwise, the units of the input will be used. The MinSimpTol and MaxSimpTol fields are added to the output to store the tolerance that was used when processing occurred.

  • For the POINT_REMOVE algorithm, the tolerance is the maximum allowable perpendicular distance between each vertex and the new line created.
  • For the BEND_SIMPLIFY algorithm, the tolerance is the diameter of a circle that approximates a significant bend.
  • For the WEIGHTED_AREA algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices. The further a triangle deviates from equilateral, the higher weight it is given, and the less likely it is to be removed.
  • For the EFFECTIVE_AREA algorithm, the square of the tolerance is the area of a significant triangle defined by three adjacent vertices.
Linear Unit
error_resolving_option
(Optional)
Legacy:

This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were resolved. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.

Boolean
collapsed_point_option
(Optional)

Specifies whether an output point feature class will be created to store the endpoints of any lines that are smaller than the spatial tolerance. The point output is derived; it will use the same name and location as the out_feature_class parameter but with a _Pnt suffix.

  • KEEP_COLLAPSED_POINTSA derived output point feature class will be created to store the endpoints of collapsed zero length lines. This is the default.
  • NO_KEEPA derived output point feature class will not be created.
Boolean
error_checking_option
(Optional)
Note:

This is a legacy parameter that is no longer used. It was formerly used to indicate how topological errors, possibly introduced during processing, were handled. This parameter is still included in the tool's syntax for compatibility in scripts and models but is hidden from the tool's dialog box.

Boolean
in_barriers
[in_barriers,...]
(Optional)

Inputs containing features to act as barriers for simplification. Resulting simplified lines will not touch or cross barrier features. For example, when simplifying contour lines, spot height features input as barriers ensure that the simplified contour lines will not simplify across these points. The output will not violate the elevation as described by measured spot heights.

Feature Layer

Derived Output

NameExplanationData Type
out_point_feature_class

When the Keep collapsed points parameter (collapsed_point_option in Python) is used, an output point feature class is created to store the endpoints of any lines that are smaller than the spatial tolerance of the data.

Feature Class

Code sample

SimplifyLine example 1 (Python window)

The following Python window script demonstrates how to use the SimplifyLine function in immediate mode.

import arcpy
import arcpy.cartography as CA
arcpy.env.workspace = "C:/data"
CA.SimplifyLine("roads.shp", 
                "C:/output/output.gdb/simplified_roads", 
                "POINT_REMOVE", 
                20)
SimplifyLine example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the SimplifyLine function.

# Name: SimplifyLine_Example2.py
# Description: Simplify line features from two feature classes, rivers and coastlines,
# while maintaining their connections

# Import system modules
import arcpy
import arcpy.management as DM
import arcpy.cartography as CA
 
# Set environment settings
arcpy.env.workspace = "C:/data/Portland.gdb/Hydrography"
 
# Set local variables
inRiverFeatures = "rivers"
inCoastlineFeatures = "coastlines"

mergedFeatures = "C:/data/PortlandOutput.gdb/merged_lines"
simplifiedFeatures = "C:/data/PortlandOutput.gdb/merged_lines_simplified"
tempLayer = "tempLyr"

outRiverFeatureClass = "C:/data/PortlandOutput.gdb/rivers_final"
outCoastlineFeatureClass = "C:/data/PortlandOutput.gdb/coastlines_final"

# Merge rivers and coastlines into one feature class, 
# assuming that they have a common f-code field 
# with value 40 for rivers and 80 for coastlines.
DM.Merge(inRiverFeatures, inCoastlineFeatures, mergedFeatures)

# Simplify all lines.
CA.SimplifyLine(mergedFeatures, 
                simplifiedFeatures, 
                "BEND_SIMPLIFY", 
                100, 
                "KEEP_COLLAPSED_POINTS")
 
# Select rivers and coastlines by their f-code values 
# and put them in separate feature classes.
DM.MakeFeatureLayer(simplifiedFeatures, tempLayer, "f-code = 40")
DM.CopyFeatures(tempLayer, outRiverFeatureClass)

DM.MakeFeatureLayer(simplifiedFeatures, tempLayer, "f-code = 80")
DM.CopyFeatures(tempLayer, outCoastlineFeatureClass)

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics