public interface PreparedGeometry
Geometrys in order to optimize the performance of repeated calls to specific geometric operations.
A given implementation may provide optimized implementations for only some of the specified methods, and delegate the remaining methods to the original Geometry operations. An implementation may also only optimize certain situations, and delegate others. See the implementing classes for documentation about which methods and situations they optimize.
Subclasses are intended to be thread-safe, to allow PreparedGeometry to be used in a multi-threaded context (which allows extracting maximum benefit from the prepared state).
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Geometry
Tests whether the base
Geometry contains a given geometry.
|
boolean |
containsProperly(Geometry
Tests whether the base
Geometry properly contains a given geometry.
|
boolean |
coveredBy(Geometry
Tests whether the base
Geometry is covered by a given geometry.
|
boolean |
covers(Geometry
Tests whether the base
Geometry covers a given geometry.
|
boolean |
crosses(Geometry
Tests whether the base
Geometry crosses a given geometry.
|
boolean |
disjoint(Geometry
Tests whether the base
Geometry is disjoint from a given geometry.
|
Geometry |
getGeometry()
Gets the original
Geometry which has been prepared.
|
boolean |
intersects(Geometry
Tests whether the base
Geometry intersects a given geometry.
|
boolean |
overlaps(Geometry
Tests whether the base
Geometry overlaps a given geometry.
|
boolean |
touches(Geometry
Tests whether the base
Geometry touches a given geometry.
|
boolean |
within(Geometry
Tests whether the base
Geometry is within a given geometry.
|
GeometrygetGeometry()
Geometry which has been prepared.
boolean contains(Geometrygeom)
Geometry contains a given geometry.
geom - the Geometry to test
Geometry.contains(Geometry)
boolean containsProperly(Geometrygeom)
Geometry properly contains a given geometry.
The containsProperly predicate has the following equivalent definitions:
[T**FF*FF*] Geometry.contains(com.vividsolutions.jts.geom.Geometry) predicate, in which test geometries can intersect the target's boundary and still be contained.
The advantage of using this predicate is that it can be computed efficiently, since it avoids the need to compute the full topological relationship of the input boundaries in cases where they intersect.
An example use case is computing the intersections of a set of geometries with a large polygonal geometry. Since intersection is a fairly slow operation, it can be more efficient to use containsProperly to filter out test geometries which lie wholly inside the area. In these cases the intersection is known a priori to be exactly the original test geometry.
geom - the Geometry to test
Geometry.contains(com.vividsolutions.jts.geom.Geometry)
boolean coveredBy(Geometrygeom)
Geometry is covered by a given geometry.
geom - the Geometry to test
Geometry.coveredBy(Geometry)
boolean covers(Geometrygeom)
Geometry covers a given geometry.
geom - the Geometry to test
Geometry.covers(Geometry)
boolean crosses(Geometrygeom)
Geometry crosses a given geometry.
geom - the Geometry to test
Geometry.crosses(Geometry)
boolean disjoint(Geometrygeom)
Geometry is disjoint from a given geometry. This method supports
GeometryCollections as input
geom - the Geometry to test
Geometry.disjoint(Geometry)
boolean intersects(Geometrygeom)
Geometry intersects a given geometry. This method supports
GeometryCollections as input
geom - the Geometry to test
Geometry.intersects(Geometry)
boolean overlaps(Geometrygeom)
Geometry overlaps a given geometry.
geom - the Geometry to test
Geometry.overlaps(Geometry)
boolean touches(Geometrygeom)
Geometry touches a given geometry.
geom - the Geometry to test
Geometry.touches(Geometry)
boolean within(Geometrygeom)
Geometry is within a given geometry.
geom - the Geometry to test
Geometry.within(Geometry)