This code demonstrates how to open an existing shapefile as a new feature set using the System.Spatial.Desktop library and then buffer the feature set.

using System.Spatial.Data;

     private void button1_Click(object sender, EventArgs e)
        {
            //Declare a new feature set
            FeatureSet fs = new FeatureSet();
            fs.FillAttributes();
            //Pass in the file path for the standard shapefile that will be opened
            fs.Open("C:\\Temp\\roads.shp");
            //An IFeatureSet that contains the factory that will buffer the feature set
            IFeatureSet iF = fs.Buffer(10, true);
            //Saves the buffered feature set as a new file.
            iF.SaveAs("C:\\Temp\roads_buffer.shp", true);
        }

Last edited Jul 8, 2010 at 4:49 PM by AlamoMan, version 4

Comments

No comments yet.