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


ITopologicalOperator.QueryClipped Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IT > ITopologicalOperator Interface > ITopologicalOperator.QueryClipped Method
ArcGIS Developer Help

ITopologicalOperator.QueryClipped Method

Redefines clippedGeometry to be the intersection of this geometry and the clipping envelope.

[Visual Basic .NET]
Public Sub QueryClipped ( _
    ByVal clipperEnvelope As IEnvelope, _
    ByVal clippedGeometry As IGeometry _
)
[C#]
public void QueryClipped (
    IEnvelope clipperEnvelope,
    IGeometry clippedGeometry
);
[C++]
HRESULT QueryClipped(
  IEnvelope* clipperEnvelope,
  IGeometry* clippedGeometry
);
[C++]
Parameters
clipperEnvelope 

clipperEnvelope is a parameter of type IEnvelope* clippedGeometry
clippedGeometry is a parameter of type IGeometry*

Product Availability

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

Description

QueryClipped returns the portion of the input Geometry that is Contained by the input Envelope.  The returned geometry is the same type as the original geometry.

Remarks

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.

The other geometry must be an high-level geometry. High-Level geometries are point, multipoint, polyline and polygon. To use it with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), path or ring they must be wrapped into high-level geometries type. The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

This method does not support GeometryBags.

QueryClipped 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