private LineSegment Flatten(int start, int end) { // make a new segment for the simplified geometry Coordinate p0 = linePts[start]; Coordinate p1 = linePts[end]; LineSegment newSeg = new LineSegment(null, p0, p1); // update the indexes Remove(line, start, end); outputIndex.Add(newSeg); return(newSeg); }
/// <summary> /// Simplify a collection of <see cref="TaggedLineString"/>s. /// </summary> /// <param name="taggedLines">the collection of lines to simplify /// </param> public void Simplify(ICollection taggedLines) { if (taggedLines == null) { throw new ArgumentNullException("taggedLines"); } for (IEnumerator i = taggedLines.GetEnumerator(); i.MoveNext();) { inputIndex.Add((TaggedLineString)i.Current); } for (IEnumerator i = taggedLines.GetEnumerator(); i.MoveNext();) { TaggedLineStringSimplifier tlss = new TaggedLineStringSimplifier(inputIndex, outputIndex); tlss.DistanceTolerance = distanceTolerance; tlss.Simplify((TaggedLineString)i.Current); } }