public void add(TaggedLineString line) { TaggedLineSegment[] segs = line.getSegments(); for (int i = 0; i < segs.length; i++) { TaggedLineSegment seg = segs[i]; add(seg); } }
/** * Simplify a collection of TaggedLineStrings * * @param taggedLines the collection of lines to simplify */ public void simplify(Collection taggedLines) { for (Iterator i = taggedLines.iterator(); i.hasNext(); ) { inputIndex.add((TaggedLineString) i.next()); } for (Iterator i = taggedLines.iterator(); i.hasNext(); ) { TaggedLineStringSimplifier tlss = new TaggedLineStringSimplifier(inputIndex, outputIndex); tlss.setDistanceTolerance(distanceTolerance); tlss.simplify((TaggedLineString) i.next()); } }
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(p0, p1); // update the indexes remove(line, start, end); outputIndex.add(newSeg); return newSeg; }
public void add(TaggedLineString line) { TaggedLineSegment[] segs = line.getSegments(); for (int i = 0; i < segs.length; i++) { TaggedLineSegment seg = segs[i]; add(seg); } }
/** * Simplify a collection of TaggedLineStrings * * @param taggedLines the collection of lines to simplify */ public void simplify(Collection taggedLines) { for (Iterator i = taggedLines.iterator(); i.hasNext(); ) { inputIndex.add((TaggedLineString) i.next()); } for (Iterator i = taggedLines.iterator(); i.hasNext(); ) { TaggedLineStringSimplifier tlss = new TaggedLineStringSimplifier(inputIndex, outputIndex); tlss.setDistanceTolerance(distanceTolerance); tlss.simplify((TaggedLineString) i.next()); } }
/** * Flattens a section of the line between * indexes <code>start</code> and <code>end</code>, * replacing them with a line between the endpoints. * The input and output indexes are updated * to reflect this. * * @param start the start index of the flattened section * @param end the end index of the flattened section * @return the new segment created */ 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(p0, p1); // update the indexes remove(line, start, end); outputIndex.add(newSeg); return newSeg; }