PLZZZ,I Need Quickly Help,How Can I Create A Linestring with it's startPoint And End One??????

Topics: Algorithms, General Topics, SharpMap Project, SharpMap v0.9 / v1.x
Jun 30, 2008 at 8:25 PM
PLZ Can ANy One Help Me in That
Coordinator
Jun 30, 2008 at 8:40 PM
Collection<Point> points = new Collection<Point>();
points.Add(new Point(x1, y1));
points.Add(new Point(x2, y2));
....

LineString ls = new LineString(points);


I havent checked this but it should get you going.. hth jd
Jun 30, 2008 at 8:48 PM
Well,Thanxx For your Quickly Respond but i wanna Ask question;

I Actually have a LineString and point which is on it and I want to Seperate this Line into two Lines,
are this way will be true ???,
What about the aother points between the startpoint and the Point i want ti split at?????
Coordinator
Jul 1, 2008 at 1:53 PM
You can access all the constituent points via either linestring.Vertices which returns Collection<Point>
or linestring.Point(index) which returns the point at index. eg


foreach(Point p in linestring.Vertices)
{
    do something
}

or

for(int i=0;i<linestring.NumPoints;i++)
{
    Point p = linestring.Point(i);
    do something
}

Jul 1, 2008 at 10:18 PM
I Tried It More and Moreeeeeeeeeeee,But it doesn't Work, just get Me 2 Vertices For the All Points.