This document was published with and applies to ArcGIS 9.3.

A 10 version also exists. A 9.2 version also exists.

A 10 version also exists. A 9.2 version also exists.

### In this topic

The Simplify method must be applied on high-level geometries only. High-level geometries are point, multipoint, polyline, and polygon. To use this method with low-level geometries, such as segments (line, circular arc, elliptic arc, Bézier curve), paths, or rings, they must be wrapped into high-level geometries types. See the following code example:

[C#]

```
```//The following code shows how to wrap a line segment into a polyline in C#.
//Assume a line (line1 as ILine) is already created.
ILine line1 = new LineClass();
ISpatialReference spatialRef = null;
object obj = Type.Missing;
ISegmentCollection segCollection = new PolylineClass()as ISegmentCollection;
segCollection.AddSegment((ISegment)line1, ref obj, ref obj);
//Set the spatial reference on the new polyline.
//The spatial reference is not transferred automatically from the segments.
IGeometry geom = segCollection as IGeometry;
geom.SpatialReference = spatialRef;
//Can now be used with ITopologicalOperator methods.

[VB.NET]

```
```' The following code shows how to wrap a line segment into a polyline in VB .NET.
' Assume a line (line1 as ILine) is already created.
Dim line1 As ILine = New LineClass
Dim spatialRef As ISpatialReference = Nothing
Dim obj As Object = Type.Missing
Dim segCollection As ISegmentCollection = CType(New PolylineClass, ISegmentCollection)
segCollection.AddSegment(CType(line1, ISegment), obj, obj)
' Set the spatial reference on the new polyline.
' The spatial reference is not transferred automatically from the segments.
Dim geom As IGeometry = CType(segCollection, IGeometry)
geom.SpatialReference = spatialRef

The Simplify method permanently alters the input geometry, making its definition topologically legal with respect to its geometry type. Before explicitly calling Simplify, determine if the geometry is simple. A geometry is known or assumed to be simple if it is an empty geometry, a geometry directly from a feature class, or output of any method of ITopologicalOperator.

A geometry is known or assumed to be not simple if it is not a new empty geometry or a geometry after projection (IGeometry.Project), generalization (IPolycurve.Generalize), or smoothing (IPolycurve.Smooth).

By setting the IsKnownSimple property to false, the user explicitly determines if the geometry is not already known or assumed to be simple, then running the IsSimple method indicates whether this geometry is topologically correct (simple). Calling either IsSimple makes the IsSimple state known to the geometry. Topologically altering the geometry makes the IsKnownSimple state false until the IsSimple state is checked again. See the following code example:

[C#]

```
```topoOp2.IsKnownSimple_2 = false;
bool bIsSimple = topoOp2.IsSimple;

[VB.NET]

```
```topoOp2.IsKnownSimple_2 = False
Dim bIsSimple As Boolean = topoOp2.IsSimple

Like the IsSimple method, Simplify first looks at the ITopologicalOperator.IsKnownSimple flag before processing. If the flag is true, operation is interrupted and the geometry is considered simple. If the flag is false, the geometry consistency is checked and the geometry is updated as needed. After calling Simplify, the IsKnownSimple flag is set to true. See the following code example:

[C#]

```
``````
topoOp2.IsKnownSimple_2 = false;
topoOp2.Simplify();
```

[VB.NET]

```
``````
topoOp2.IsKnownSimple_2 = False
topoOp2.Simplify()
```