C//调用Geoprocessor裁剪输出的代码 clip

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://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=13962&highlight=%2BGeoprocessor
           
        
        }

你可能感兴趣的:(String,null,dataset)