Class RectangleContains
java.lang.Object
org.locationtech.jts.operation.predicate.RectangleContains
Optimized implementation of the contains spatial predicate
for cases where the first
Geometry
is a rectangle.
This class works for all input geometries, including
GeometryCollection
s.
As a further optimization, this class can be used to test many geometries against a single rectangle in a slightly more efficient way.
- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRectangleContains
(Polygon rectangle) Create a new contains computer for two geometries. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
Tests whether a rectangle contains a given geometry.private boolean
private boolean
Tests if a line segment is contained in the boundary of the target rectangle.private boolean
Tests if a linestring is completely contained in the boundary of the target rectangle.private boolean
Tests if a point is contained in the boundary of the target rectangle.private boolean
isPointContainedInBoundary
(Point point)
-
Field Details
-
rectEnv
-
-
Constructor Details
-
RectangleContains
Create a new contains computer for two geometries.- Parameters:
rectangle
- a rectangular geometry
-
-
Method Details
-
contains
Tests whether a rectangle contains a given geometry.- Parameters:
rectangle
- a rectangular Polygonb
- a Geometry of any type- Returns:
- true if the geometries intersect
-
contains
-
isContainedInBoundary
-
isPointContainedInBoundary
-
isPointContainedInBoundary
Tests if a point is contained in the boundary of the target rectangle.- Parameters:
pt
- the point to test- Returns:
- true if the point is contained in the boundary
-
isLineStringContainedInBoundary
Tests if a linestring is completely contained in the boundary of the target rectangle.- Parameters:
line
- the linestring to test- Returns:
- true if the linestring is contained in the boundary
-
isLineSegmentContainedInBoundary
Tests if a line segment is contained in the boundary of the target rectangle.- Parameters:
p0
- an endpoint of the segmentp1
- an endpoint of the segment- Returns:
- true if the line segment is contained in the boundary
-