JTS Topology Suite version 1.13

## com.vividsolutions.jts.operation.overlay
Class OverlayOp

    java.lang.Object
      com.vividsolutions.jts.operation.GeometryGraphOperation
          com.vividsolutions.jts.operation.overlay.OverlayOp

    public class OverlayOp

extends GeometryGraphOperation

Computes the overlay of two `Geometry`s. The overlay can be used to determine any boolean combination of the geometries.

Version:
  1.7

Field Summary
`static int` `DIFFERENCE`
`static int` `INTERSECTION` The spatial functions supported by this class.
`static int` `SYMDIFFERENCE`
`static int` `UNION`

Fields inherited from class com.vividsolutions.jts.operation.GeometryGraphOperation
`arg, li, resultPrecisionModel`

Constructor Summary
`OverlayOp(Geometry g0, Geometry g1)`

Method Summary
`static Geometry` `createEmptyResult(int opCode, Geometry a, Geometry b, GeometryFactory geomFact)` Creates an empty result geometry of the appropriate dimension, based on the dimensions of the inputs.
`PlanarGraph` `getGraph()`
`Geometry` `getResultGeometry(int funcCode)`
`protected void` `insertUniqueEdge(Edge e)` Insert an edge from one of the noded input graphs.
`boolean` `isCoveredByA(Coordinate coord)` This method is used to decide if an L edge should be included in the result or not.
`boolean` `isCoveredByLA(Coordinate coord)` This method is used to decide if a point node should be included in the result or not.
`static boolean` `isResultOfOp(int loc0, int loc1, int opCode)` This method will handle arguments of Location.NONE correctly
`static boolean` `isResultOfOp(Label label, int opCode)`
`static Geometry` `overlayOp(Geometry geom0, Geometry geom1, int opCode)`

Methods inherited from class com.vividsolutions.jts.operation.GeometryGraphOperation
`getArgGeometry, setComputationPrecision`

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

Field Detail

### INTERSECTION

    public static final int INTERSECTION

  The spatial functions supported by this class. These operations implement various boolean combinations of the resultants of the overlay.

  See Also:
    Constant Field Values

### UNION

    public static final int UNION

See Also:
  Constant Field Values

### DIFFERENCE

    public static final int DIFFERENCE

See Also:
  Constant Field Values

### SYMDIFFERENCE

    public static final int SYMDIFFERENCE

See Also:
  Constant Field Values

Constructor Detail

### OverlayOp

    public OverlayOp(Geometry g0,
                     Geometry g1)

Method Detail

### overlayOp

    public static Geometry overlayOp(Geometry geom0,
                                     Geometry geom1,
                                     int opCode)

### isResultOfOp

    public static boolean isResultOfOp(Label label,
                                       int opCode)

### isResultOfOp

    public static boolean isResultOfOp(int loc0,
                                       int loc1,
                                       int opCode)

  This method will handle arguments of Location.NONE correctly

  Returns:
    true if the locations correspond to the opCode

### getResultGeometry

    public Geometry getResultGeometry(int funcCode)

### getGraph

    public PlanarGraph getGraph()

### insertUniqueEdge

    protected void insertUniqueEdge(Edge e)

  Insert an edge from one of the noded input graphs. Checks edges that are inserted to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge.

### isCoveredByLA

    public boolean isCoveredByLA(Coordinate coord)

  This method is used to decide if a point node should be included in the result or not.

  Returns:
    true if the coord point is covered by a result Line or Area geometry

### isCoveredByA

    public boolean isCoveredByA(Coordinate coord)

  This method is used to decide if an L edge should be included in the result or not.

  Returns:
    true if the coord point is covered by a result Area geometry

### createEmptyResult

    public static Geometry createEmptyResult(int opCode,
                                             Geometry a,
                                             Geometry b,
                                             GeometryFactory geomFact)

  Creates an empty result geometry of the appropriate dimension, based on the dimensions of the inputs. The created geometry is always an atomic geometry, not a collection.

  Implements the following rules:

  - `intersection` - result has the dimension of the lowest input dimension
  - `union` - result has the dimension of the highest input dimension
  - `difference` - result has the dimension of the left-hand input
  - `symDifference` - result has the dimension of the highest input dimension (since symDifference is the union of the differences).

  Parameters:
    `opCode` - the overlay operation being performed
    `a` - an input geometry
    `b` - an input geometry
    `geomFact` - the geometry factory being used for the operation
  Returns:
    an empty atomic geometry of the appropriate dimension

JTS Topology Suite version 1.13