欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

arcgis 线自动构面的步骤一例

更新时间: 2014-01-05 02:02:44 责任编辑: Author_N1

 

arcgis 线自动构面的方法一例
arcgis 线自动构面的方法一例
public class CreatePolygonTools
    {
        //自动构造面  
        public static bool AutoCompleteFromGeometries(GeometryBagClass enumGeoLines, IFeatureClass fc_polygon)
        {
            bool rbc = false;            
            IGeoDataset geoDS = fc_polygon as IGeoDataset;
            IEnvelope processingBounds = geoDS.Extent;
            IWorkspace ws = (fc_polygon as IDataset).Workspace;
            ISelectionSet selSet;
            IInvalidArea invalidArea = new InvalidAreaClass();
            //
            IFeatureConstruction pfeatBuild = new FeatureConstructionClass();
            pfeatBuild.AutoCompleteFromGeometries(fc_polygon, processingBounds, enumGeoLines, invalidArea, 0.0001, ws, out selSet);
            //
            rbc=true;
            return rbc;
        }
        //构面  从线图层
        public static bool ConstructPolygons(IFeatureClass fc_line, IFeatureClass fc_polygon)
        {
            bool rbc = false;
            ICancelOperation cancel = new CancelOperationClass();            
            //
            IFeatureCursor pLineSrc = fc_line.Search(null, false);
            IFeatureConstruction pfeatBuild = new FeatureConstructionClass();
            pfeatBuild.ConstructPolygonsFromFeaturesFromCursor(cancel, fc_polygon, null, false, false, pLineSrc, null, 0.001, null);
            //
            if (pLineSrc != null)
            {
                TokayWorkspace.ComRelease(pLineSrc);
                pLineSrc = null;
            }
            rbc = true;
            return rbc;
        }
        //构面 选中要素集
        public bool ConstructPolygonsFromFeatures(IEnumFeature pEnumFeature, IFeatureClass fc_polygon)
        {
            bool rbc = false;
            ICancelOperation cancel = new CancelOperationClass();            
            //            
            IFeatureConstruction pfeatBuild = new FeatureConstructionClass();
            pfeatBuild.ConstructPolygonsFromFeatures(cancel, fc_polygon, null, false, false, pEnumFeature, null, 0.001, null);
            //            
            rbc = true;
            return rbc;
        }

    }
    public class CancelOperationClass : ICancelOperation
    {
        private Boolean isCancelled = false;
        public Boolean IsCancelled { get { return isCancelled; } }

        public void Cancel() { isCancelled = true; }
    }

上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:02:44
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/4916/
本文WWW.DOC100.NET DOC100.NET版权所有。