## com.vividsolutions.jts.precision
Class CommonBitsOp

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

public class CommonBitsOp
extends java.lang.Object

Provides versions of Geometry spatial functions which use common bit removal to reduce the likelihood of robustness problems.

In the current implementation no rounding is performed on the reshifted result geometry, which means that it is possible that the returned Geometry is invalid. Client classes should check the validity of the returned result themselves.

Version:
  1.7

Constructor Summary
`CommonBitsOp()` Creates a new instance of class, which reshifts result `Geometry`s.
`CommonBitsOp(boolean returnToOriginalPrecision)` Creates a new instance of class, specifying whether the result `Geometry`s should be reshifted.

Method Summary
`Geometry` `buffer(Geometry geom0, double distance)` Computes the buffer a geometry, using enhanced precision.
`Geometry` `difference(Geometry geom0, Geometry geom1)` Computes the set-theoretic difference of two `Geometry`s, using enhanced precision.
`Geometry` `intersection(Geometry geom0, Geometry geom1)` Computes the set-theoretic intersection of two `Geometry`s, using enhanced precision.
`Geometry` `symDifference(Geometry geom0, Geometry geom1)` Computes the set-theoretic symmetric difference of two geometries, using enhanced precision.
`Geometry` `union(Geometry geom0, Geometry geom1)` Computes the set-theoretic union of two `Geometry`s, using enhanced precision.

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

Constructor Detail

### CommonBitsOp

    public CommonBitsOp()

  Creates a new instance of class, which reshifts result `Geometry`s.

### CommonBitsOp

    public CommonBitsOp(boolean returnToOriginalPrecision)

  Creates a new instance of class, specifying whether the result `Geometry`s should be reshifted.

Parameters:
  `returnToOriginalPrecision` -

Method Detail

### intersection

    public Geometry intersection(Geometry geom0,
                                 Geometry geom1)

  Computes the set-theoretic intersection of two `Geometry`s, using enhanced precision.

  Parameters:
    `geom0` - the first Geometry
    `geom1` - the second Geometry
  Returns:
    the Geometry representing the set-theoretic intersection of the input Geometries.

### union

    public Geometry union(Geometry geom0,
                          Geometry geom1)

  Computes the set-theoretic union of two `Geometry`s, using enhanced precision.

  Parameters:
    `geom0` - the first Geometry
    `geom1` - the second Geometry
  Returns:
    the Geometry representing the set-theoretic union of the input Geometries.

### difference

    public Geometry difference(Geometry geom0,
                               Geometry geom1)

  Computes the set-theoretic difference of two `Geometry`s, using enhanced precision.

  Parameters:
    `geom0` - the first Geometry
    `geom1` - the second Geometry, to be subtracted from the first
  Returns:
    the Geometry representing the set-theoretic difference of the input Geometries.

### symDifference

    public Geometry symDifference(Geometry geom0,
                                  Geometry geom1)

  Computes the set-theoretic symmetric difference of two geometries, using enhanced precision.

  Parameters:
    `geom0` - the first Geometry
    `geom1` - the second Geometry
  Returns:
    the Geometry representing the set-theoretic symmetric difference of the input Geometries.

### buffer

    public Geometry buffer(Geometry geom0,
                           double distance)

  Computes the buffer a geometry, using enhanced precision.

  Parameters:
    `geom0` - the Geometry to buffer
    `distance` - the buffer distance
  Returns:
    the Geometry representing the buffer of the input Geometry.