Package nz.org.riskscape.engine.geo
Class OverlayOperations
java.lang.Object
nz.org.riskscape.engine.geo.OverlayOperations
Performs geometry overlay operations on two geometries. These overlay operations are done here
(instead of call lhs.intersection(rhs)) to allow greater control on the Noder
implementation that is used. This can greatly reduce the chance of an overlay operation resulting
in the dreaded TopologyException
.
Note that the geometries returned from these operations are not guaranteed to be homogeneous. If
homogeneous geometries are required see GeometryUtils.removeNonFamilyMembers(Geometry, GeometryFamily)
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.locationtech.jts.geom.Geometry
apply
(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs, int overlayOp) Applies a geometric overlay operation to the left and right hand side geometries.org.locationtech.jts.geom.Geometry
difference
(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs) static OverlayOperations
get()
org.locationtech.jts.geom.Geometry
intersection
(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs)
-
Constructor Details
-
OverlayOperations
public OverlayOperations()
-
-
Method Details
-
get
- Returns:
- A general purpose
OverlayOperations
.
-
apply
protected abstract org.locationtech.jts.geom.Geometry apply(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs, int overlayOp) Applies a geometric overlay operation to the left and right hand side geometries.
- Parameters:
lhs
- left hand side geometryrhs
- right hand side geometryoverlayOp
- operation to perform- Returns:
- result of applying the overlay operation to lhs/rhs
-
intersection
public org.locationtech.jts.geom.Geometry intersection(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs) - Returns:
- the geometric intersection of lhs/rhs
-
difference
public org.locationtech.jts.geom.Geometry difference(org.locationtech.jts.geom.Geometry lhs, org.locationtech.jts.geom.Geometry rhs) - Returns:
- the geometric difference of lhs/rhs
-