ArcObjects Library Reference (Geometry)  

IConstructMerge.MergeGeometries Method

Merges the representation from both versions of a geometry that has been modifed

[Visual Basic .NET]
Public Function MergeGeometries ( _
    ByVal pOriginal As IGeometry, _
    ByVal pEdit1 As IGeometry, _
    ByVal pEdit2 As IGeometry _
) As IGeometry
[C#]
public IGeometry MergeGeometries (
    IGeometry pOriginal,
    IGeometry pEdit1,
    IGeometry pEdit2
);
[C++]
HRESULT MergeGeometries(
  IGeometry* pOriginal,
  IGeometry* pEdit1,
  IGeometry* pEdit2,
  IGeometry** ppMerged
);
[C++]

Parameters

pOriginal

  pOriginal is a parameter of type IGeometry

pEdit1

  pEdit1 is a parameter of type IGeometry

pEdit2

  pEdit2 is a parameter of type IGeometry

ppMerged [out, retval]

  ppMerged is a parameter of type IGeometry

Product Availability

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

Description

Constructs a new geometry by merging the two separate edits of the same original geometry. If any portion of the two edited regions or the edits themselves overlaps an error will be returned. Edited regions are the areas of the polygon or polyline where the edits took place in respect to the original geometry.  Edits are the changes reflected in the two edited geometries.
In polygons it is the area that the edit has been affected as well as the vertices and edges that participated in the edits that are important. Even if edits are on non-consecutive edges or non-consecutive vertices, if the area that one edit adds or subtracts from the polygon overlaps the second edit this will be viewed as a conflict and the geometries will not be merged.


The functionality is fully implemented for multipart features. 

Remarks

IConstructMerge pConstMrg = new GeometryEnvironmentClass() as IConstructMerge;

/*IGeometry origGeom;

IGeometry geom1;

IGeometry geom2;

...*/

IGeometry newGeom = pConstMrg.MergeGeometries(origGeom, geom1, geom2);

See Also

IConstructMerge Interface

.NET Related Topics

How to merge conflicting geometries during a reconcile |