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

To trace a line among two points ???

Topics: General Topics
Jan 31, 2007 at 5:22 PM
As I do to trace a line among two points ???

Thank you

Ibraim Mansur
Jan 31, 2007 at 5:47 PM
Hi Ibraim,

Please take a look at the GeometryProvider.

Jan 31, 2007 at 7:15 PM
Do you have some example?

Ibraim Mansur
Jan 31, 2007 at 7:56 PM
you have to create a collection of Geometry objects, and then a GeometryProvider from those lines, something like-

SharpMap.Layers.VectorLayer layerLines;
List<SharpMap.Geometries.Geometry> geometryLines;
layerLines = new SharpMap.Layers.VectorLayer(layerName);
geometryLines = new List<SharpMap.Geometries.Geometry>();

// create layer and geometry list
layerLines.DataSource = new SharpMap.Data.Providers.GeometryProvider(geometryLines);
layerLines.Style.Line.Width = 4;
layerLines.Style.Line.Color = System.Drawing.Color.Green;

//Add a single LineString with 2 Points
List<SharpMap.Geometries.Point> PointColl = new List<SharpMap.Geometries.Point>();
PointColl.Add(new SharpMap.Geometries.Point(X, Y));
PointColl.Add(new SharpMap.Geometries.Point(X2, Y2));

SharpMap.Geometries.LineString lineString = new SharpMap.Geometries.LineString(PointColl);