关键字 Geoprocessor Intersect IFeatureLayers IGpValueTableObject

http://forums.arcgis.com/threads/2390-Using-the-Intersect-Geoprocessor-with-IFeatureLayers-in-C // LOJIC.ArcGIS.Carto.Layers.GetFeatureLayerByName is a function to get the featurelayer IFeatureLayer pParcelFLayer = LOJIC.ArcGIS.Carto.Layers.GetFeatureLayerByName(fa rmassessment.m_mxDocument.ActiveView, "Parcel Lines"); IFeatureLayer pSoilsFLayer = LOJIC.ArcGIS.Carto.Layers.GetFeatureLayerByName(fa rmassessment.m_mxDocument.ActiveView, "Soils"); // String for the output path String stroutput = "J:\\pva\\Appdata\\Farm\\fa" + strParcelID; //Setting up the Geoprocessor Geoprocessor GP = new Geoprocessor(); GP.OverwriteOutput = true; ESRI.ArcGIS.AnalysisTools.Intersect intersectLayers = new Intersect(); //using the IGpValueTableObject to add multiple featurelayer from the TOC to the Input of the Intersect Geopros. IGpValueTableObject valTbl = new GpValueTableObjectClass(); valTbl.SetColumns(2); object row = ""; object rank = 1; row = pParcelFLayer; valTbl.SetRow(0, ref row); valTbl.SetValue(0, 1, ref rank); row = pSoilsFLayer; valTbl.SetRow(1, ref row); rank = 2; valTbl.SetValue(1, 1, ref rank); intersectLayers.in_features = valTbl; intersectLayers.out_feature_class = stroutput; intersectLayers.join_attributes = "ALL"; intersectLayers.output_type = "INPUT"; GP.Execute(intersectLayers, null);
posted @ 2012-07-16 14:54  adodo1  Views(126)  Comments(0Edit  收藏  举报