com.vividsolutions.jts.operation.overlay

Class 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(Label label, int opCode)
static boolean
isResultOfOp(int loc0, int loc1, int opCode)
This method will handle arguments of Location.NONE correctly
static Geometry
overlayOp(Geometry geom0, Geometry geom1, int opCode)

Methods inherited from class com.vividsolutions.jts.operation.GeometryGraphOperation

getArgGeometry, setComputationPrecision

Field Details

DIFFERENCE

public static final int DIFFERENCE
Field Value:
3

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.
Field Value:
1

SYMDIFFERENCE

public static final int SYMDIFFERENCE
Field Value:
4

UNION

public static final int UNION
Field Value:
2

Constructor Details

OverlayOp

public OverlayOp(Geometry g0,
                 Geometry g1)

Method Details

getGraph

public PlanarGraph getGraph()

getResultGeometry

public Geometry getResultGeometry(int funcCode)

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.

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

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

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

overlayOp

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