ArcObjects Library Reference  (Geometry)    

ITopologicalOperator.ConstructUnion Method

Defines this geometry to be the union of the inputs. More efficient for unioning multiple geometries than calling Union repeatedly.

[Visual Basic 6.0]
Sub ConstructUnion(
    ByVal geometries As IEnumGeometry _
)
[Visual Basic .NET]
Public Sub ConstructUnion ( _
    ByVal geometries As IEnumGeometry _
)
[C#]
public void ConstructUnion (
    IEnumGeometry geometries
);
[Java]
public void constructUnion (
    IEnumGeometry geometries
)
throws
    IOException,
    AutomationException
[C++]
HRESULT ConstructUnion(
  IEnumGeometry* geometries
);
[C++]

Parameters

geometries

  geometries is a parameter of type IEnumGeometry

Product Availability

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

Description

ConstructUnion simultaneously Unions an Enumeration of geometries of the same Dimension into a single geometry.  ConstructUnion is more efficient for unioning a large collection of geometries simultaneously rather than cycling through each geometry individually.

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.

This method does not support GeometryBags.

[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

 

[Visual Basic 6.0]

'How to wrap a line segment into a polyline in VB6

'Assume a line (pLine as ILine) is already created

dim psc as ISegmentCollection

set psc = New Polyline

psc.addsegment pline

'Set the spatial reference on the new polyline

'The spatial reference is not transfered automatically from the segments

dim pgeo as IGeometry

set pgeo = psc

set pgeo.SpatialReference = pMyspatialReference

'Can now be used with ITopologicalOperator methods

See Also

ITopologicalOperator Interface

 


Feedback Send feedback on this page