/** * Sets the distance tolerance for the simplification. * All vertices in the simplified geometry will be within this * distance of the original geometry. * The tolerance value must be non-negative. A tolerance value * of zero is effectively a no-op. * * @param distanceTolerance the approximation tolerance to use */ public void setDistanceTolerance(double distanceTolerance) { if (distanceTolerance < 0.0) throw new IllegalArgumentException("Tolerance must be non-negative"); lineSimplifier.setDistanceTolerance(distanceTolerance); }
public Geometry getResultGeometry() { // empty input produces an empty result if (inputGeom.isEmpty()) return (Geometry) inputGeom.clone(); linestringMap = new HashMap(); inputGeom.apply(new LineStringMapBuilderFilter()); lineSimplifier.simplify(linestringMap.values()); Geometry result = (new LineStringTransformer()).transform(inputGeom); return result; }
public Geometry getResultGeometry() { // empty input produces an empty result if (inputGeom.isEmpty()) return (Geometry) inputGeom.clone(); linestringMap = new HashMap(); inputGeom.apply(new LineStringMapBuilderFilter()); lineSimplifier.simplify(linestringMap.values()); Geometry result = (new LineStringTransformer()).transform(inputGeom); return result; }
/** * Sets the distance tolerance for the simplification. * All vertices in the simplified geometry will be within this * distance of the original geometry. * The tolerance value must be non-negative. A tolerance value * of zero is effectively a no-op. * * @param distanceTolerance the approximation tolerance to use */ public void setDistanceTolerance(double distanceTolerance) { if (distanceTolerance < 0.0) throw new IllegalArgumentException("Tolerance must be non-negative"); lineSimplifier.setDistanceTolerance(distanceTolerance); }