/** * Simplifies a part of the <code>points</code>. The <code>fromIndex</code> and <code>lastIndex</code> * are guaranteed to be kept. * * @param points The PointList to simplify * @param fromIndex Start index to simplify, should be >= <code>lastIndex</code> * @param lastIndex Simplify up to this index * @return The number of removed points */ public int simplify(PointList points, int fromIndex, int lastIndex) { int removed = 0; int size = lastIndex - fromIndex; if (approx) { int delta = 500; int segments = size / delta + 1; int start = fromIndex; for (int i = 0; i < segments; i++) { // start of next is end of last segment, except for the last removed += subSimplify(points, start, Math.min(lastIndex, start + delta)); start += delta; } } else { removed = subSimplify(points, fromIndex, lastIndex); } if (removed > 0) compressNew(points, removed); return removed; }
/** * Simplifies a part of the <code>points</code>. The <code>fromIndex</code> and <code>lastIndex</code> * are guaranteed to be kept. * * @param points The PointList to simplify * @param fromIndex Start index to simplify, should be >= <code>lastIndex</code> * @param lastIndex Simplify up to this index * @return The number of removed points */ public int simplify(PointList points, int fromIndex, int lastIndex) { int removed = 0; int size = lastIndex - fromIndex; if (approx) { int delta = 500; int segments = size / delta + 1; int start = fromIndex; for (int i = 0; i < segments; i++) { // start of next is end of last segment, except for the last removed += subSimplify(points, start, Math.min(lastIndex, start + delta)); start += delta; } } else { removed = subSimplify(points, fromIndex, lastIndex); } if (removed > 0) compressNew(points, removed); return removed; }
/** * This method removes points which are close to the line (defined by maxDist). * <p> * * @return removed nodes */ public int simplify(PointList points) { int removed = 0; int size = points.getSize(); if (approx) { int delta = 500; int segments = size / delta + 1; int start = 0; for (int i = 0; i < segments; i++) { // start of next is end of last segment, except for the last removed += simplify(points, start, Math.min(size - 1, start + delta)); start += delta; } } else { removed = simplify(points, 0, size - 1); } compressNew(points, removed); return removed; }
/** * This method removes points which are close to the line (defined by maxDist). * <p> * @return removed nodes */ public int simplify( PointList points ) { int removed = 0; int size = points.getSize(); if (approx) { int delta = 500; int segments = size / delta + 1; int start = 0; for (int i = 0; i < segments; i++) { // start of next is end of last segment, except for the last removed += simplify(points, start, Math.min(size - 1, start + delta)); start += delta; } } else { removed = simplify(points, 0, size - 1); } compressNew(points, removed); return removed; }