com.vividsolutions.jts.operation.overlay
Class OverlayOp

java.lang.Object
  extended bycom.vividsolutions.jts.operation.GeometryGraphOperation
      extended bycom.vividsolutions.jts.operation.overlay.OverlayOp

public class OverlayOp
extends GeometryGraphOperation

Computes the overlay of two Geometrys. 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, cga, li, resultPrecisionModel
 
Constructor Summary
OverlayOp(Geometry g0, Geometry g1)
           
 
Method Summary
 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