This project has moved. For the latest updates, please go here.

Connected points

Topics: Algorithms, SharpMap Project
Jul 23, 2008 at 11:24 AM
Hi All, I want create new LINES layer, that every point was connecting to next point Sample: -------0-------------0----------------0------- I'm write next code: public SharpMap.Layers.VectorLayer CreateTrackerLayer(List<CDataItem> lst) { if (lst == null || lst.Count == 0) return null; SharpMap.Layers.VectorLayer laySelected = new SharpMap.Layers.VectorLayer("tracker102_layer"); Collection<SharpMap .Geometries.Geometry=""> geoList = new Collection<SharpMap .Geometries.Geometry="">(); foreach (CDataItem di in lst) { geoList.Add(new SharpMap.Geometries.Point(di.Lon, di.Lat)); } laySelected.DataSource = new SharpMap.Data.Providers.GeometryProvider(geoList); laySelected.SRID = 4326; laySelected.Style.Symbol = new Bitmap(HttpContext.Current.Server.MapPath(@"Pictures\Purpose1.gif")); return laySelected; } But it drawing only separate points (without line) Any ideas ?
Jul 23, 2008 at 11:30 AM
Hi artemon, you need to create a new LineString  - see the constructor that takes a collection of points hth jd
Jul 24, 2008 at 3:34 AM
Thanks John, it works!!!