矢量图层叠加求交

            IMap pMap = axMapControl1.Map;
            ITable pInTable = ((IFeatureLayer)pMap.get_Layer(0)).FeatureClass as ITable;
            ITable pTempTable = ((IFeatureLayer)pMap.get_Layer(1)).FeatureClass as ITable;

            IFeatureClassName pName = new FeatureClassNameClass();
            pName.FeatureType = esriFeatureType.esriFTSimple;
            pName.ShapeFieldName = "shape";
            pName.ShapeType = esriGeometryType.esriGeometryPolygon;

 


            IWorkspaceName pWsName = new WorkspaceNameClass();
            pWsName.WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory";
            pWsName.PathName = @"C:\Data";
            IDatasetName pDatasetName = pName as IDatasetName;
            pDatasetName.Name = "Interset_resultaa";
            pDatasetName.WorkspaceName = pWsName;

            IBasicGeoprocessor pBGeoOr = new BasicGeoprocessorClass();
            IFeatureClass pFeaCls = pBGeoOr.Intersect(pInTable, false, pTempTable, false, 0, pName);

            IFeatureLayer pFeaLyr = new FeatureLayerClass();
            pFeaLyr.FeatureClass = pFeaCls;
            pFeaLyr.Name = pFeaCls.AliasName;
            pMap.AddLayer(pFeaLyr as ILayer);

你可能感兴趣的:(矢量)