Arcengine implements merge functions
Private igeometry getgeo (ifeaturelayer pflyr)
{
Ienumgeometry pgos = new enumfeaturegeometryclass ();
Ienumgeometrybind pgeosbind = pgos as ienumgeometrybind;
Ifeatureselection pflyrselection = pflyr as ifeatureselection;
Pflyrselection. selectfeatures (null, esriselectionresultenum. esriselectionresultnew, false); pgeosbind. bindgeometrysource (null, pflyrselection. selectionset );
Pgos. Reset ();
Ipolympus Gon spoly = new polygonclass ();
Itopologicaloperator ptopo = spoly as itopologicaloperator;
Ptopo. constructunion (pgos );
Ptopo. Simplify ();
Spoly = ptopo as ipolympus gon;
Pflyrselection. Clear ();
Return spoly;
}
Execute the code snippet above to merge all objects on the layer. Pay attention to the line of code in the red part. If this line of code is not written, the number of images in the pgos is 0, and the final spoly is empty.
From: http://program.ntwtsp.com/aspnet/18234.htm