This document is archived and information here might be outdated.  Recommended version.


ITopologicalOperator.Clip Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Geometry)  

ITopologicalOperator.Clip Method

Constructs the intersection of this geometry and the specified envelope.

[Visual Basic .NET]
Public Sub Clip ( _
    ByVal clipperEnvelope As IEnvelope _
)
[C#]
public void Clip (
    IEnvelope clipperEnvelope
);
[C++]
HRESULT Clip(
  IEnvelope* clipperEnvelope
);
[C++]

Parameters clipperEnvelope
clipperEnvelope is a parameter of type IEnvelope*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The Clip method clips the geometry with the input envelope.

Remarks

Use QueryClipped or QueryClippedDense methods to send the results to a different polygon.

ITopologicalOperator methods 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.

ITopologicalOperator Clip Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

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 transfered automatically from the segments

IGeometry geom=segCollection as IGeometry;

geom.SpatialReference=spatialRef;

//Can now be used with ITopologicalOperator methods

 

See Also

ITopologicalOperator Interface