org.geotools.geometry.iso.operation.overlay
Class OverlayOp

java.lang.Object
  extended by org.geotools.geometry.iso.operation.GeometryGraphOperation
      extended by org.geotools.geometry.iso.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.


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 org.geotools.geometry.iso.operation.GeometryGraphOperation
arg, cga, li, resultPrecisionModel
 
Constructor Summary
OverlayOp(GeometryImpl g0, GeometryImpl g1)
          Initializes a new Overlay Operation between two geometric objects
 
Method Summary
 GeometryImpl createGeometry(java.util.List<org.opengis.geometry.primitive.OrientableSurface> aSurfaces, java.util.List<org.opengis.geometry.primitive.OrientableCurve> aCurves, java.util.List<org.opengis.geometry.primitive.Point> aPoints)
          Creates a new Geometry object appropriate to the input Primitives.
 PlanarGraph getGraph()
           
 GeometryImpl getResultGeometry(int funcCode)
          Computes and returns the resulting geometry according to the function code parameter.
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 GeometryImpl overlayOp(GeometryImpl geom0, GeometryImpl geom1, int opCode)
           
 
Methods inherited from class org.geotools.geometry.iso.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(GeometryImpl g0,
                 GeometryImpl g1)
          throws UnsupportedDimensionException
Initializes a new Overlay Operation between two geometric objects

Parameters:
g0 - First geometric object
g1 - Second geometric object
Throws:
UnsupportedDimensionException
Method Detail

overlayOp

public static GeometryImpl overlayOp(GeometryImpl geom0,
                                     GeometryImpl geom1,
                                     int opCode)
                              throws UnsupportedDimensionException
Parameters:
geom0 -
geom1 -
opCode -
Returns:
Throws:
UnsupportedDimensionException

isResultOfOp

public static boolean isResultOfOp(Label label,
                                   int opCode)
Parameters:
label -
opCode -
Returns:

isResultOfOp

public static boolean isResultOfOp(int loc0,
                                   int loc1,
                                   int opCode)
This method will handle arguments of Location.NONE correctly

Parameters:
loc0 -
loc1 -
opCode -
Returns:

getResultGeometry

public GeometryImpl getResultGeometry(int funcCode)
Computes and returns the resulting geometry according to the function code parameter.

Parameters:
funcCode - Function code
Returns:
Result geometry

getGraph

public PlanarGraph getGraph()
Returns:

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

createGeometry

public GeometryImpl createGeometry(java.util.List<org.opengis.geometry.primitive.OrientableSurface> aSurfaces,
                                   java.util.List<org.opengis.geometry.primitive.OrientableCurve> aCurves,
                                   java.util.List<org.opengis.geometry.primitive.Point> aPoints)
Creates a new Geometry object appropriate to the input Primitives. The method will return a Primitive object, if one list contains only one element and the rest is empty. In all other cases, that is that exist more than one Primitive in the lists, the method will return a Complex object.

Parameters:
aSurfaces - List of Surfaces
aCurves - List of Curves
aPoints - List of Points
Returns:
a Geometry instance. That is a Point/Curve/Surface if the parameters only contain one point or one curve or one surface. It is a MultiPoint/MultiCurve/MultiSurface if the parameters contain one list with more than two entries and the other two lists are empty. Or it is a MultiPrimitive if the parameters contain a mixture of points, curves and surfaces.


Copyright © 1996-2010 Geotools. All Rights Reserved.