faysalmirmd

How to Use ArcMap Buffer tool in c#

Apr 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. public static void MakeBufferLayer(string inputFeatureclasspath, string outputFeatureclassPath, string buffer_distance_or_field)
  2.         {
  3.             Geoprocessor GP = new Geoprocessor();
  4.             GP.OverwriteOutput = true;
  5.             GP.AddOutputsToMap = false;
  6.             ESRI.ArcGIS.AnalysisTools.Buffer bufferTool = new
  7.               ESRI.ArcGIS.AnalysisTools.Buffer();
  8.  
  9.             bufferTool.in_features = inputFeatureclasspath;
  10.             bufferTool.out_feature_class = outputFeatureclassPath;// outputFeatureclassPath;
  11.             bufferTool.buffer_distance_or_field = buffer_distance_or_field;
  12.            
  13.             try
  14.             {
  15.                 GP.Execute(bufferTool, null);
  16.             }
  17.             catch (Exception e)
  18.             {
  19.                 MessageBox.Show(ErrorMessages.GetErrorByCode(137)+" "+ErrorMessages.GetErrorByCode(100),"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
  20.             }
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment