@Test public void extendBoundingBoxTest() { BoundingBox boundingBox1 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox2 = new BoundingBox(MIN_LATITUDE - 1, MIN_LONGITUDE - 1, MAX_LATITUDE, MAX_LONGITUDE); BoundingBox boundingBox3 = new BoundingBox(MIN_LATITUDE, MIN_LONGITUDE, MAX_LATITUDE + 1, MAX_LONGITUDE + 1); Assert.assertEquals(boundingBox1, boundingBox1.extendBoundingBox(boundingBox1)); Assert.assertEquals(boundingBox2, boundingBox1.extendBoundingBox(boundingBox2)); Assert.assertEquals(boundingBox3, boundingBox1.extendBoundingBox(boundingBox3)); }
public BoundingBox extendBoundingBox(BoundingBox boundingBox) { return new BoundingBox(Math.min(this.minLatitude, boundingBox.minLatitude), Math.min(this.minLongitude, boundingBox.minLongitude), Math.max(this.maxLatitude, boundingBox.maxLatitude), Math.max(this.maxLongitude, boundingBox.maxLongitude)); }
BoundingBox implements Serializable { public BoundingBox extendBoundingBox(BoundingBox boundingBox) { return new BoundingBox(Math.min(this.minLatitude, boundingBox.minLatitude), Math.min(this.minLongitude, boundingBox.minLongitude), Math.max(this.maxLatitude, boundingBox.maxLatitude), Math.max(this.maxLongitude, boundingBox.maxLongitude)); } }
BoundingBox implements Serializable { public BoundingBox extendBoundingBox(BoundingBox boundingBox) { return new BoundingBox(Math.min(this.minLatitude, boundingBox.minLatitude), Math.min(this.minLongitude, boundingBox.minLongitude), Math.max(this.maxLatitude, boundingBox.maxLatitude), Math.max(this.maxLongitude, boundingBox.maxLongitude)); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); }
BoundingBox implements Serializable { public BoundingBox extendBoundingBox(BoundingBox boundingBox) { return new BoundingBox(Math.min(this.minLatitude, boundingBox.minLatitude), Math.min(this.minLongitude, boundingBox.minLongitude), Math.max(this.maxLatitude, boundingBox.maxLatitude), Math.max(this.maxLongitude, boundingBox.maxLongitude)); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); static BoundingBox fromString(String boundingBoxString); boolean contains(double latitude, double longitude); boolean contains(LatLong latLong); @Override boolean equals(Object obj); BoundingBox extendBoundingBox(BoundingBox boundingBox); BoundingBox extendCoordinates(double latitude, double longitude); BoundingBox extendCoordinates(LatLong latLong); BoundingBox extendDegrees(double verticalExpansion, double horizontalExpansion); BoundingBox extendMargin(float margin); BoundingBox extendMeters(int meters); LatLong getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); Rectangle getPositionRelativeToTile(Tile tile); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); boolean intersectsArea(LatLong[][] latLongs); @Override String toString(); }
BoundingBox implements Serializable { public BoundingBox extendBoundingBox(BoundingBox boundingBox) { return new BoundingBox(Math.min(this.minLatitude, boundingBox.minLatitude), Math.min(this.minLongitude, boundingBox.minLongitude), Math.max(this.maxLatitude, boundingBox.maxLatitude), Math.max(this.maxLongitude, boundingBox.maxLongitude)); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude);  BoundingBox(List<LatLong> latLongs); static BoundingBox fromString(String boundingBoxString); boolean contains(double latitude, double longitude); boolean contains(LatLong latLong); @Override boolean equals(Object obj); BoundingBox extendBoundingBox(BoundingBox boundingBox); BoundingBox extendCoordinates(double latitude, double longitude); BoundingBox extendCoordinates(LatLong latLong); BoundingBox extendDegrees(double verticalExpansion, double horizontalExpansion); BoundingBox extendMargin(float margin); BoundingBox extendMeters(int meters); LatLong getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); Rectangle getPositionRelativeToTile(Tile tile); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); boolean intersectsArea(LatLong[][] latLongs); @Override String toString(); final double maxLatitude; final double maxLongitude; final double minLatitude; final double minLongitude; }