Solved! Go to Solution.
without the actual code fragment it is very difficult to help.
Here you are creating a new polyline:
polyline = (Polyline)serverContext.CreateObject("esriGeometry.Polyline");
Here you are performing a QI from IPoint to IPointCollection:
pointCollection = polyline as IPointCollection;
Here you are adding points to the point collection:
for (int count = 0; count < geoDataArray.Length; count++)
{
pointArray = geoDataArray[count].Split(new char[] { ',' });
latitude = Convert.ToDouble(pointArray[0].ToString());
longitude = Convert.ToDouble(pointArray[1].ToString());
point.X = latitude;
point.Y = longitude;
pointCollection.AddPoint(point, ref missingObject, ref missingObject);
}
At this point you have created the polyline and added the points.
But, here you add the points again by adding the point collection to the polyline:
polyline.AddPointCollection(pointCollection);
You don't want to do that because you're adding the points twice.
point.X = latitude; point.Y = longitude;