CodePlexProject Hosting for Open Source Software
Documentation DotSpatial.Data Desktop_SampleCode LFCS
using DotSpatial.Data; using DotSpatial.Topology; namespace SampleCode { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //Creates a random number generator Random rnd = new Random(); //creates a new coordiante array Coordinate[] c = new Coordinate[36]; //for loop that will generate 36 random numbers for (int i = 0; i < 36; i++) { c[i] = new Coordinate((rnd.NextDouble() * 360) - 180, (rnd.NextDouble() * 180) - 90); } //creates a linestring from the coordinate array LineString ls = new LineString(c); //creates a feature from the linestring Feature f = new Feature(ls); FeatureSet fs = new FeatureSet(f.FeatureType); fs.Features.Add(f); } }
Last edited Jul 19, 2012 at 4:57 PM by mudnug, version 6