Hi Emil,
Here I am taking a DataTable(as in uploaded image) ,which contains coordinates(lat long) of From(F_LON,F_LAT) and To points(T_LON,T_LAT) and joining these points using LINESTRING as shown in the below code.
for (int i = 0; i < dt.Rows.Count; i++)
{
RectangleShape worldExtent = proj.ConvertToExternalProjection(new RectangleShape(-180, 90, 180, -90));
Vertex vfrom, vto;
vfrom = proj.ConvertToExternalProjection(Convert.ToDouble(dt.Rows[i]["FromLon"].ToString()), Convert.ToDouble(dt.Rows[l]["FromLat"].ToString()));
vto = proj.ConvertToExternalProjection(Convert.ToDouble(dt.Rows[i]["ToLon"].ToString()), Convert.ToDouble(dt.Rows[i]["ToLat"].ToString()));
PointShape pfrom = new PointShape(vfrom.X, vfrom.Y);
PointShape pto = new PointShape(vto.X, vto.Y);
Feature from = new Feature(pfrom);
Feature to = new Feature(pto);
im.InternalFeatures.Add(from);
im.InternalFeatures.Add(to);
Feature fline = new Feature("LINESTRING(" + pfrom.X + " " + pfrom.Y + "," + pto.X + " " + pto.Y + ")");
}
im.InternalFeatures.Add(fline);
The result was like in first image of my previous post.
Thanks,
Silpa.