Interface PreparedGeometry
-
- All Known Implementing Classes:
PreparedLineString,PreparedPoint,PreparedPolygon
public interface PreparedGeometryAn interface for classes which prepareGeometrys 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
Geometryoperations. 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
PreparedGeometryto be used in a multi-threaded context (which allows extracting maximum benefit from the prepared state).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(Geometry geom)Tests whether the baseGeometrycontains a given geometry.booleancontainsProperly(Geometry geom)Tests whether the baseGeometryproperly contains a given geometry.booleancoveredBy(Geometry geom)Tests whether the baseGeometryis covered by a given geometry.booleancovers(Geometry geom)Tests whether the baseGeometrycovers a given geometry.booleancrosses(Geometry geom)Tests whether the baseGeometrycrosses a given geometry.booleandisjoint(Geometry geom)Tests whether the baseGeometryis disjoint from a given geometry.GeometrygetGeometry()Gets the originalGeometrywhich has been prepared.booleanintersects(Geometry geom)Tests whether the baseGeometryintersects a given geometry.booleanoverlaps(Geometry geom)Tests whether the baseGeometryoverlaps a given geometry.booleantouches(Geometry geom)Tests whether the baseGeometrytouches a given geometry.booleanwithin(Geometry geom)Tests whether the baseGeometryis within a given geometry.
-
-
-
Method Detail
-
getGeometry
Geometry getGeometry()
Gets the originalGeometrywhich has been prepared.- Returns:
- the base geometry
-
contains
boolean contains(Geometry geom)
Tests whether the baseGeometrycontains a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry contains the given Geometry
- See Also:
Geometry.contains(Geometry)
-
containsProperly
boolean containsProperly(Geometry geom)
Tests whether the baseGeometryproperly contains a given geometry.The
containsProperlypredicate has the following equivalent definitions:- Every point of the other geometry is a point of this geometry's interior.
- The DE-9IM Intersection Matrix for the two geometries matches
[T**FF*FF*]
Geometry.contains(org.meteoinfo.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.
- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry properly contains the given Geometry
- See Also:
Geometry.contains(org.meteoinfo.jts.geom.Geometry)
-
coveredBy
boolean coveredBy(Geometry geom)
Tests whether the baseGeometryis covered by a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry is covered by the given Geometry
- See Also:
Geometry.coveredBy(Geometry)
-
covers
boolean covers(Geometry geom)
Tests whether the baseGeometrycovers a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry covers the given Geometry
- See Also:
Geometry.covers(Geometry)
-
crosses
boolean crosses(Geometry geom)
Tests whether the baseGeometrycrosses a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry crosses the given Geometry
- See Also:
Geometry.crosses(Geometry)
-
disjoint
boolean disjoint(Geometry geom)
Tests whether the baseGeometryis disjoint from a given geometry. This method supportsGeometryCollections as input- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry is disjoint from the given Geometry
- See Also:
Geometry.disjoint(Geometry)
-
intersects
boolean intersects(Geometry geom)
Tests whether the baseGeometryintersects a given geometry. This method supportsGeometryCollections as input- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry intersects the given Geometry
- See Also:
Geometry.intersects(Geometry)
-
overlaps
boolean overlaps(Geometry geom)
Tests whether the baseGeometryoverlaps a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry overlaps the given Geometry
- See Also:
Geometry.overlaps(Geometry)
-
touches
boolean touches(Geometry geom)
Tests whether the baseGeometrytouches a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry touches the given Geometry
- See Also:
Geometry.touches(Geometry)
-
within
boolean within(Geometry geom)
Tests whether the baseGeometryis within a given geometry.- Parameters:
geom- the Geometry to test- Returns:
- true if this Geometry is within the given Geometry
- See Also:
Geometry.within(Geometry)
-
-