## com.vividsolutions.jts.operation.overlay.snap
Class GeometrySnapper

    java.lang.Object
      com.vividsolutions.jts.operation.overlay.snap.GeometrySnapper

public class GeometrySnapper
extends java.lang.Object

Snaps the vertices and segments of a `Geometry` to another Geometry's vertices. Improves robustness for overlay operations, by eliminating nearly parallel edges (which cause problems during noding and intersection calculation).

Version:
  1.7
Author:
  Martin Davis

Constructor Summary
`GeometrySnapper(Geometry srcGeom)` Creates a new snapper acting on the given geometry

Method Summary
`static double` `computeOverlaySnapTolerance(Geometry g)` Estimates the snap tolerance for a Geometry, taking into account its precision model.
`static double` `computeOverlaySnapTolerance(Geometry g0, Geometry g1)`
`static double` `computeSizeBasedSnapTolerance(Geometry g)`
`Coordinate[]` `extractTargetCoordinates(Geometry g)`
`static Geometry[]` `snap(Geometry g0, Geometry g1, double snapTolerance)` Snaps two geometries together with a given tolerance.
`Geometry` `snapTo(Geometry snapGeom, double snapTolerance)` Snaps the vertices in the component `LineString`s of the source geometry to the vertices of the given snap geometry.

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

Constructor Detail

### GeometrySnapper

    public GeometrySnapper(Geometry srcGeom)

  Creates a new snapper acting on the given geometry

Parameters:
  `srcGeom` - the geometry to snap

Method Detail

### computeOverlaySnapTolerance

    public static double computeOverlaySnapTolerance(Geometry g)

  Estimates the snap tolerance for a Geometry, taking into account its precision model.

  Parameters:
    `g` - a Geometry
  Returns:
    the estimated snap tolerance

### computeSizeBasedSnapTolerance

    public static double computeSizeBasedSnapTolerance(Geometry g)

### computeOverlaySnapTolerance

    public static double computeOverlaySnapTolerance(Geometry g0,
                                                     Geometry g1)

### snap

    public static Geometry[] snap(Geometry g0,
                                  Geometry g1,
                                  double snapTolerance)

  Snaps two geometries together with a given tolerance.

  Parameters:
    `g0` - a geometry to snap
    `g1` - a geometry to snap
    `snapTolerance` - the tolerance to use
  Returns:
    the snapped geometries

### snapTo

    public Geometry snapTo(Geometry snapGeom,
                           double snapTolerance)

  Snaps the vertices in the component `LineString`s of the source geometry to the vertices of the given snap geometry.

  Parameters:
    `snapGeom` - a geometry to snap the source to
  Returns:
    a new snapped Geometry

### extractTargetCoordinates

    public Coordinate[] extractTargetCoordinates(Geometry g)