标签:
private void StartClip(IFeatureLayer inputfeaturelayer, IFeatureClass cliplayerClass, IFeatureWorkspace pOutFeatureWorkSapce, string pOutFeatclsName) { Geoprocessor gp = new Geoprocessor(); gp.OverwriteOutput = true; IFeatureClass inputfeatureclass = inputfeaturelayer.FeatureClass; //IFeatureClass clipfeatureclass = cliplayerClass.FeatureClass; IDataset dataset = inputfeatureclass as IDataset; //IWorkspace workspace = dataset.Workspace; //IFeatureWorkspace fworkspace = workspace as IFeatureWorkspace; IFields outfields = inputfeatureclass.Fields; IFeatureClass outfeatureclass = pOutFeatureWorkSapce.CreateFeatureClass(pOutFeatclsName, outfields, null, null, esriFeatureType.esriFTSimple, "Shape", ""); ESRI.ArcGIS.AnalysisTools.Clip clipTool = new ESRI.ArcGIS.AnalysisTools.Clip(inputfeatureclass, cliplayerClass, outfeatureclass); gp.Execute(clipTool, null); IFeatureLayer outlayer = new FeatureLayerClass(); outlayer.FeatureClass = outfeatureclass; outlayer.Name = outfeatureclass.AliasName; //将裁剪输出的加载到当前Mapcontrol上 //pMap.AddLayer((ILayer)outlayer); }
标签:
原文地址:http://www.cnblogs.com/lee24789229/p/5541283.html