This project has moved and is read-only. For the latest updates, please go here.

Connected points

Topics: Algorithms, SharpMap Project
Jul 23, 2008 at 12:24 PM
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 12:30 PM
Hi artemon, you need to create a new LineString  - see the constructor that takes a collection of points hth jd
Jul 24, 2008 at 4:34 AM
Thanks John, it works!!!