예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string text;

            text = textBox1.Text;


            Geoprocessor GP = new Geoprocessor();

            GP.OverwriteOutput = true;
            ESRI.ArcGIS.AnalysisTools.Buffer pBuffer = new ESRI.ArcGIS.AnalysisTools.Buffer();

            ILayer        pLayer    = aMap.get_Layer(0);
            IFeatureLayer featLayer = pLayer as IFeatureLayer;

            pBuffer.in_features = featLayer;
            string filepath = @"c:\temp";

            pBuffer.out_feature_class = filepath + "\\" + pLayer.Name + ".shp";

            pBuffer.buffer_distance_or_field = text;
            pBuffer.dissolve_option          = "ALL";

            GP.Execute(pBuffer, null);

            aMap.AddShapeFile(filepath, pLayer.Name);

            aMap.MoveLayerTo(1, 0);
        }