日期:2014-05-17  浏览次数:20900 次

ArcEngine合并线状要素的问题
要编码实现合并线状要素,在网上找了好多资料,大概都类似下面的代码,但是执行了之后都没什么效果,并没有合并,不知道为什么哦,请大神们给点意见吧!
//             Polyline pPolyline = null;
            ITopologicalOperator pTopologicalOperator;
            IFeature pFeatureTemp = pTypeArray[0] as IFeature;
            IGeometry pGeometry = pFeatureTemp.Shape;
            int jj = 1;
            while (jj < nFeatureCount)
            {
                pTopologicalOperator = pGeometry as ITopologicalOperator;
                pGeometry = ((IFeature)pTypeArray[jj]).Shape;
                pGeometry = pTopologicalOperator.Union(pGeometry as IGeometry);
                jj++;
            }
//             pPolyline = pGeometry as IPolyline;
ArcEngine 线状要素合并 错误 Union ArcEngine编辑

------解决方案--------------------
以前做的项目,整个合并的函数如下
     
private void MergeFeatures(List<int> OneFeatureArr
{
            IFeatureLayer tFeatureLayer = tSelectLayer as IFeatureLayer;
            IFeatureClass pFeatureClass = tFeatureLayer.FeatureClass;
            var pDataset = pFeatureClass as IDataset;