Class S2EdgeUtil.XYZPruner
java.lang.Object
com.google.common.geometry.S2EdgeUtil.XYZPruner
- Enclosing class:
S2EdgeUtil
The purpose of this class is to find edges that intersect a given XYZ bounding box. It can be
used as an efficient rejection test when attempting to find edges that intersect a given
region. It accepts a vertex chain v0, v1, v2, ... and returns a boolean value indicating
whether each edge intersects the specified bounding box.
We use XYZ intervals instead of something like longitude intervals because it is cheap to collect from S2Point lists and any slicing strategy should give essentially equivalent results. See S2Loop for an example of use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEdgeToBounds(S2Point from, S2Point to) Accumulate a bounding rectangle from provided edges.booleanintersects(S2Point v1) Returns true if the edge going from the last point to this point passes through the pruner bounding box, otherwise returns false.void
-
Constructor Details
-
XYZPruner
public XYZPruner()
-
-
Method Details
-
addEdgeToBounds
-
setFirstIntersectPoint
-
intersects
Returns true if the edge going from the last point to this point passes through the pruner bounding box, otherwise returns false. So the method returns false if we are certain there is no intersection, but it may return true when there turns out to be no intersection.
-