# How Simplify Line and Simplify Polygon work

The Simplify Line, Simplify Polygon, and Simplify Shared Edges tools simplify lines and polygons to reduce feature complexity for display at smaller scales. The tools operate by identifying and removing relatively insignificant vertices to reduce feature complexity while retaining inherent character and shape. There are different simplification algorithms, which will generate slightly different results.

## Simplification algorithms

### Retain critical points (Douglas-Peucker)

The Retain critical points (Douglas-Peucker) (algorithm='POINT_REMOVE' in Python) option provides fast, simple line simplification algorithm. It keeps critical points that depict the essential shape of a line and removes all other points. The algorithm begins by connecting the endpoints of a line with a trend line. The distance of each vertex to the trend line is measured perpendicularly. Vertices closer to the line than the tolerance are eliminated. The line is then divided by the vertex farthest from the trend line, which makes two new trend lines. The remaining vertices are measured against these lines, and the process continues until all vertices within the tolerance are eliminated. This option is based on the algorithm defined by Douglas and Peucker (1973).

Retain critical points (Douglas-Peucker) is efficient for data compression and for eliminating redundant details; however, the line that results may contain unpleasant sharp angles and spikes that reduce the cartographic quality of the line. Use Retain critical points (Douglas-Peucker) for relatively small amounts of data reduction or compression and when you don't need high cartographic quality.

### Retain critical bends (Wang-Müller)

The Retain critical bends (Wang-Müller) (algorithm='BEND_SIMPLIFY' in Python) algorithm applies shape recognition techniques that detect bends, analyze their characteristics, and eliminate insignificant ones. A linear feature can be seen as composed by a series of bends (Wang, 1996), each defined as having the same sign (positive or negative) for the inflection angles at its consecutive vertices. Several geometrical properties of each bend are compared with those of a reference half circle, the diameter of which equals the specified simplification tolerance. These measures determine whether a bend is kept or eliminated, meaning replacing the bend by its baseline (the line connecting the endpoints of the bend). The simplification takes place iteratively such that the smaller bends may disappear in the early rounds and, therefore, form bigger bends. The resulting line follows the main shape of the original line more faithfully and shows better cartographic quality than from Retain critical points (Douglas-Peucker). This option is based on the algorithm defined by Wang and Müller (1998).

### Retain weighted effective areas (Zhou-Jones)

The Retain weighted effective areas (Zhou-Jones) algorithm (algorithm='WEIGHTED_AREA' in Python) works by first identifying triangles of effective area for each vertex. Those 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 option is based on the algorithm defined by Zhou and Jones (2005).

### Retain effective areas (Visvalingam-Whyatt)

The Retain effective areas (Visvalingam-Whyatt) (algorithm='EFFECTIVE_AREA' in Python) algorithm works by assigning vertices a relative importance based on the size of a triangle formed by each vertex and its two neighbors, and then removing the least important vertices first. Removing the vertices associated with the smallest triangles will have the smallest impact on the character of the line or outline. The process is iterative so that after a first pass is made to remove vertices, the triangles are recomputed from the remaining vertices, and the process continues. This option is based on the algorithm defined by Visvalingam and Whyatt (1992).

## Maintaining topological integrity

The tools ensure that topology is maintained during processing. Topological errors will not be introduced. In cases where simplification would otherwise result in a topology violation, the tools first try to split the geometry into two parts, and simplify them independently. This is a recursive process. The sub-parts may be subsequently split again, and so on. If topology cannot be maintained using this approach, the feature is put in waiting, and revisited after neighboring features have been processed, to see if the topology can then be maintained.

##### Legacy:

In previous versions of these tools, it was possible that topological errors might be generated during processing. Parameters were included to identify and optionally resolve these errors. The tools no longer introduce topological errors at all, eliminating the need for checking and resolution. The Check for topological errors (error_checking_option in Python) and the Resolve topological errors (error_resolving_option in Python) parameters are still included in the tools' syntax for compatibility in scripts and models but are now non-functional and are hidden from the tool's dialog.

The SimPgnFlag field (in the case of Simplify Polygon) or the SimLnFlag field (in the case of Simplify Line) is added to the output feature class to flag topology errors that were present in the input feature class. Previous versions of these tools used these fields to flag topological errors that were introduced by the tool processing instead. Also, in the course of topology resolution, previous versions of the tools modified tolerance on a per-feature basis, and stored those values in the MinSimpTol and MaxSimpTol fields. In the current implementation, the values in these tolerance fields will be the same, and equal to the tolerance specified in the Simplification Tolerance parameter. Be sure to modify existing models or scripts that rely on any of these fields.

Use the Input barrier layers parameter to define one or more feature classes that contain features that should not be crossed by simplified lines or polygons. Examples include lakes and rivers where simplified roads should not be, elevation spot heights or other survey markers that contour lines cannot cross, or administrative boundaries, where simplified data must remain wholly within.

## Analyzing and improving the results

The tools simplify lines and polygon outlines one at a time; the longer a line or outline runs, the more pleasing the result will be. Keep this in mind when you collect or construct the source data. Wherever possible, position endpoints of lines on long, smooth sections of lines, rather than at severely angled sections.

Topology problems in the input feature class—features that overlap other features without an intersection point—are flagged in a field in the input feature class. This field is named SimPgnFlag in the case of Simplify Polygon and SimLinFlag in the case of Simplify Line. A value of 1 in these fields indicates that a topological error was present for that feature in the input feature class.

For reference, an ID field corresponding to the object ID of the input feature is also added to the output feature class. The field is called InPoly_FID in the case of the Simplify Polygon tool, or InLine_FID in the case of the Simplify Line tool. In addition, MinSimpTol and MaxSimpTol fields are added to the output to store the tolerance that was used.

A derived point output feature class is created of point features that represent either the endpoints of lines simplified to zero-length lines in the case of Simplify Line), or polygons simplified to zero-area polygons or to a polygon smaller than the minimum area as defined by the Minimum Area parameter in the case of Simplify Polygon, or possibly both in the case of Simplify Shared Edges. A simplified polygon that has been reduced to empty geometry or to a polygon smaller than the minimum area as defined by the Minimum Area parameter.

## Working with large datasets

The topology handling of these tools require that multiple features be considered simultaneously. When you work with large datasets, you may exceed memory limitations. In this case, consider processing input data by partitions. You can do this by identifying a relevant polygon feature class in the Cartographic Partitions environment setting that covers and subdivides the input data. Portions of the data, defined by partition boundaries, will be simplified sequentially, but the output feature class will be seamless and consistent at partition edges. See Generalizing large datasets using partitions for more information.

## References

Douglas, David H., and Thomas K. Peucker. 1973. "Algorithms for the Reduction of the Number of Points Required to Represent a Digitised Line or its Caricature." The Canadian Cartographer, 10(2): 112–122.

Wang, Zeshen, and Jean-Claude Müller. 1998. "Line Generalization Based on Analysis of Shape Characteristics." Cartography and Geographic Information Systems 25(1): 3–15.

Zhou, Sheng, and, Christopher B. Jones. 2005. "Shape-Aware Line Generalisation with Weighted Effective Area." In Developments in Spatial Handling: 11th International Symposium on Spatial Handling, edited by Peter F. Fisher, 369–80.

Visvalingam, M., and, J. D. Whyatt. 1992. "Line Generalisation by Repeated Elimination of the Smallest Area," Cartographic Information Systems Research Group (CISRG) Discussion Paper 10, The University of Hull.