Package org.locationtech.jts.geom.prep
Class PreparedPolygonContains
- java.lang.Object
-
- org.locationtech.jts.geom.prep.PreparedPolygonPredicate
-
- org.locationtech.jts.geom.prep.AbstractPreparedPolygonContains
-
- org.locationtech.jts.geom.prep.PreparedPolygonContains
-
class PreparedPolygonContains extends AbstractPreparedPolygonContains
Computes the contains spatial relationship predicate for aPreparedPolygon
relative to all otherGeometry
classes. Uses short-circuit tests and indexing to improve performance.It is not possible to short-circuit in all cases, in particular in the case where the test geometry touches the polygon linework. In this case full topology must be computed.
-
-
Field Summary
-
Fields inherited from class org.locationtech.jts.geom.prep.AbstractPreparedPolygonContains
requireSomePointInInterior
-
Fields inherited from class org.locationtech.jts.geom.prep.PreparedPolygonPredicate
prepPoly
-
-
Constructor Summary
Constructors Constructor Description PreparedPolygonContains(PreparedPolygon prepPoly)
Creates an instance of this operation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Geometry geom)
Tests whether this PreparedPolygon contains a given geometry.static boolean
contains(PreparedPolygon prep, Geometry geom)
Computes the contains predicate between aPreparedPolygon
and aGeometry
.protected boolean
fullTopologicalPredicate(Geometry geom)
Computes the full topological contains predicate.-
Methods inherited from class org.locationtech.jts.geom.prep.AbstractPreparedPolygonContains
eval
-
Methods inherited from class org.locationtech.jts.geom.prep.PreparedPolygonPredicate
isAllTestComponentsInTarget, isAllTestComponentsInTargetInterior, isAnyTargetComponentInAreaTest, isAnyTestComponentInTarget, isAnyTestComponentInTargetInterior
-
-
-
-
Constructor Detail
-
PreparedPolygonContains
public PreparedPolygonContains(PreparedPolygon prepPoly)
Creates an instance of this operation.- Parameters:
prepPoly
- the PreparedPolygon to evaluate
-
-
Method Detail
-
contains
public static boolean contains(PreparedPolygon prep, Geometry geom)
Computes the contains predicate between aPreparedPolygon
and aGeometry
.- Parameters:
prep
- the prepared polygongeom
- a test geometry- Returns:
- true if the polygon contains the geometry
-
contains
public boolean contains(Geometry geom)
Tests whether this PreparedPolygon contains a given geometry.- Parameters:
geom
- the test geometry- Returns:
- true if the test geometry is contained
-
fullTopologicalPredicate
protected boolean fullTopologicalPredicate(Geometry geom)
Computes the full topological contains predicate. Used when short-circuit tests are not conclusive.- Specified by:
fullTopologicalPredicate
in classAbstractPreparedPolygonContains
- Parameters:
geom
- the test geometry- Returns:
- true if this prepared polygon contains the test geometry
-
-