## com.bbn.openmap.util
Class FanCompress

    java.lang.Object
      com.bbn.openmap.util.FanCompress

Direct Known Subclasses:
  FanCompress.FloatCompress

public abstract class FanCompress
extends java.lang.Object

Class to perform fan compression on points.

### FAN COMPRESSION

- R.A. Fowell, and D.D. McNeil, Faster Plots by Fan Data-Compression, IEEE Computer Graphics & Applications, 1989, 58-66.
- See also, J.G. Dunham, Optimum uniformr piecewise linear approximation of planar curves, IEEE Trans. Pat. Anal and Mach. Intel, Vol, PAMI-8, No 1, 1986, p. 67-75.

Nested Class Summary
`static class` `FanCompress.FanPoint`
`static class` `FanCompress.FloatCompress` FanCompress class for float values.

Constructor Summary
`FanCompress()`

Method Summary
`static void` `fan_compress(FanCompress fan, double epsilon)` Perform fan compression.
`abstract boolean` `next_point(FanCompress.FanPoint p)` Get the next point.
`abstract void` `save_point(double x, double y)` Save coordinates.
`abstract void` `set_coalesce_points(double epsilon)` Save only unique coordinates.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FanCompress

    public FanCompress()

Method Detail

### next_point

    public abstract boolean next_point(FanCompress.FanPoint p)

  Get the next point.

  Parameters:
    `p` - FanPoint
  Returns:
    boolean false if no more points.

### save_point

    public abstract void save_point(double x,
                                    double y)

  Save coordinates.

  Parameters:
    `x` - coordinate
    `y` - coordinate

### set_coalesce_points

    public abstract void set_coalesce_points(double epsilon)

  Save only unique coordinates. If several points are the same, then coalesce them into one point.

  Parameters:
    `epsilon` - threshold used to determine uniqueness of coordinates.

### fan_compress

    public static final void fan_compress(FanCompress fan,
                                          double epsilon)

  Perform fan compression. IF there is only 1 point, save-point will be run on it twice, sorry.

  Parameters:
    `fan` - FanCompress object
    `epsilon` - double

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details