/// <summary>
        /// Simplifies a collection of <c>TaggedLineString</c>s.
        /// </summary>
        /// <param name="taggedLines">The collection of lines to simplify.</param>
        public void Simplify(ICollection <TaggedLineString> taggedLines)
        {
            foreach (var taggedLineString in taggedLines)
            {
                _inputIndex.Add(taggedLineString);
            }

            foreach (var taggedLineString in taggedLines)
            {
                var tlss = new TaggedLineStringSimplifier(_inputIndex, _outputIndex);
                tlss.DistanceTolerance = DistanceTolerance;
                tlss.Simplify(taggedLineString);
            }

            /*
             * 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);
             * }
             */
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        private LineSegment Flatten(int start, int end)
        {
            // make a new segment for the simplified point
            Coordinate  p0     = _linePts[start];
            Coordinate  p1     = _linePts[end];
            LineSegment newSeg = new LineSegment(p0, p1);

            // update the indexes
            Remove(_line, start, end);
            _outputIndex.Add(newSeg);
            return(newSeg);
        }
示例#3
0
 /// <summary>
 /// Simplifies a collection of <c>TaggedLineString</c>s.
 /// </summary>
 /// <param name="taggedLines">The collection of lines to simplify.</param>
 public void Simplify(ICollection <TaggedLineString> taggedLines)
 {
     foreach (TaggedLineString taggedLineString in taggedLines)
     {
         _inputIndex.Add(taggedLineString);
     }
     foreach (TaggedLineString taggedLineString in taggedLines)
     {
         TaggedLineStringSimplifier tlss = new TaggedLineStringSimplifier(_inputIndex, _outputIndex);
         tlss.DistanceTolerance = DistanceTolerance;
         tlss.Simplify(taggedLineString);
     }
 }