以前得到的结果老是某一个,用下面的方法就可以获取合并后的结果
IGeometry pUnionGeo = null;
var bFirst = true;
foreach (IGeometry pGeo in pGeometrys)
{
if (pGeo != null && !pGeo.IsEmpty)
{
//RepairSelfIntersection(pGeo);
if (bFirst)
{
pUnionGeo = pGeo;
bFirst = false;
}
else
{
pUnionGeo = (pUnionGeo as ITopologicalOperator).Union(pGeo);
}
}
}
return pUnionGeo;