JTS Topology Suite - v 1.12

## com.vividsolutions.jts.precision
Class CommonBitsRemover

    java.lang.Object
      com.vividsolutions.jts.precision.CommonBitsRemover

    public class CommonBitsRemover

extends java.lang.Object

Removes common most-significant mantissa bits from one or more `Geometry`s.

The CommonBitsRemover "scavenges" precision which is "wasted" by a large displacement of the geometry from the origin. For example, if a small geometry is displaced from the origin by a large distance, the displacement increases the significant figures in the coordinates, but does not affect the relative topology of the geometry. Thus the geometry can be translated back to the origin without affecting its topology. In order to compute the translation without affecting the full precision of the coordinate values, the translation is performed at the bit level by removing the common leading mantissa bits.

If the geometry envelope already contains the origin, the translation procedure cannot be applied. In this case, the common bits value is computed as zero.

If the geometry crosses the Y axis but not the X axis (and mutatis mutandum), the common bits for Y are zero, but the common bits for X are non-zero.

Version:
  1.7

Constructor Summary
`CommonBitsRemover()`

Method Summary
`void` `add(Geometry geom)` Add a geometry to the set of geometries whose common bits are being computed.
`void` `addCommonBits(Geometry geom)` Adds the common coordinate bits back into a Geometry.
`Coordinate` `getCommonCoordinate()` The common bits of the Coordinates in the supplied Geometries.
`Geometry` `removeCommonBits(Geometry geom)` Removes the common coordinate bits from a Geometry.

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

Constructor Detail

### CommonBitsRemover

    public CommonBitsRemover()

Method Detail

### add

    public void add(Geometry geom)

  Add a geometry to the set of geometries whose common bits are being computed. After this method has executed the common coordinate reflects the common bits of all added geometries.

  Parameters:
    `geom` - a Geometry to test for common bits

### getCommonCoordinate

    public Coordinate getCommonCoordinate()

  The common bits of the Coordinates in the supplied Geometries.

### removeCommonBits

    public Geometry removeCommonBits(Geometry geom)

  Removes the common coordinate bits from a Geometry. The coordinates of the Geometry are changed.

  Parameters:
    `geom` - the Geometry from which to remove the common coordinate bits
  Returns:
    the shifted Geometry

### addCommonBits

    public void addCommonBits(Geometry geom)

  Adds the common coordinate bits back into a Geometry. The coordinates of the Geometry are changed.

  Parameters:
    `geom` - the Geometry to which to add the common coordinate bits

JTS Topology Suite - v 1.12