AE中使用Geoprocessor 的clip处理输出矢量数据

    Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            IFeatureLayer inputfeaturelayer = pMap.get_Layer(0) as IFeatureLayer;
            IFeatureLayer cliplayer = pMap.get_Layer(1) as IFeatureLayer;
            IFeatureClass inputfeatureclass = inputfeaturelayer.FeatureClass;
            IFeatureClass clipfeatureclass = cliplayer.FeatureClass;
            IDataset dataset = inputfeatureclass as IDataset;
            IWorkspace workspace = dataset.Workspace;
            IFeatureWorkspace fworkspace = workspace as IFeatureWorkspace;
            IFields outfields = inputfeatureclass.Fields;
            IFeatureClass outfeatureclass = fworkspace.CreateFeatureClass("Clip_result", outfields, null, null, esriFeatureType.esriFTSimple, "Shape", "");

            ESRI.ArcGIS.AnalysisTools.Clip clipTool =
                new ESRI.ArcGIS.AnalysisTools.Clip(inputfeatureclass, clipfeatureclass, outfeatureclass);

            gp.Execute(clipTool, null);
            IFeatureLayer outlayer = new FeatureLayerClass();
            outlayer.FeatureClass = outfeatureclass;
            outlayer.Name = outfeatureclass.AliasName;
            pMap.AddLayer((ILayer)outlayer);

            axMapControlMain.ActiveView.Refresh();

你可能感兴趣的:(process)