Class BBoxCalculator
- java.lang.Object
-
- org.locationtech.spatial4j.shape.impl.BBoxCalculator
-
public class BBoxCalculator extends java.lang.Object(INTERNAL) Calculates the minimum bounding box given a bunch of rectangles (ranges). It's a temporary object and not thread-safe; throw it away when done. For a cartesian space, the calculations are trivial but it is not for geodetic. For geodetic, it must maintain an ordered set of disjoint ranges as each range is provided.
-
-
Field Summary
Fields Modifier and Type Field Description private SpatialContextctxprivate doublemaxXprivate doublemaxYprivate doubleminXprivate doubleminYprivate java.util.TreeMap<java.lang.Double,java.lang.Double>rangesSorted list of disjoint X ranges keyed by maxX and with minX stored as the "value".
-
Constructor Summary
Constructors Constructor Description BBoxCalculator(SpatialContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoesXWorldWrap()voidexpandRange(double minX, double maxX, double minY, double maxY)voidexpandRange(Rectangle rect)voidexpandXRange(double minX, double maxX)RectanglegetBoundary()doublegetMaxX()doublegetMaxY()doublegetMinX()doublegetMinY()private voidprocessRanges()private static booleanrangeContains(double minX, double maxX, double x)
-
-
-
Field Detail
-
ctx
private final SpatialContext ctx
-
minY
private double minY
-
maxY
private double maxY
-
minX
private double minX
-
maxX
private double maxX
-
ranges
private java.util.TreeMap<java.lang.Double,java.lang.Double> ranges
Sorted list of disjoint X ranges keyed by maxX and with minX stored as the "value".
-
-
Constructor Detail
-
BBoxCalculator
public BBoxCalculator(SpatialContext ctx)
-
-
Method Detail
-
expandRange
public void expandRange(Rectangle rect)
-
expandRange
public void expandRange(double minX, double maxX, double minY, double maxY)
-
expandXRange
public void expandXRange(double minX, double maxX)
-
processRanges
private void processRanges()
-
rangeContains
private static boolean rangeContains(double minX, double maxX, double x)
-
doesXWorldWrap
public boolean doesXWorldWrap()
-
getBoundary
public Rectangle getBoundary()
-
getMinX
public double getMinX()
-
getMaxX
public double getMaxX()
-
getMinY
public double getMinY()
-
getMaxY
public double getMaxY()
-
-