Sample code that demonstrates how to create a Multi Line Feature Set

using DotSpatial.Data;
using DotSpatial.Topology;

        private void button1_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();
            Feature f = new Feature();
            FeatureSet fs = new FeatureSet(f.FeatureType);
            for (int ii = 0; ii < 40; ii++)
            {
                Coordinate[] coord = new Coordinate[36];
                for (int i = 0; i < 36; i++)
                {
                    coord[i] = new Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90);
                }
                LineString ls = new LineString(coord);
                f = new Feature(ls);
                fs.Features.Add(f);
            }
            fs.SaveAs("C:\\Temp\\test.shp", true);
        }

Last edited May 20, 2015 at 5:09 PM by mbayles, version 3