Expand the bounding box by the LatLng

@param boundingBox bounding box
@param latLng      lat lng
186611
private void expandBoundingBox(BoundingBox boundingBox, LatLng latLng) {

        double latitude = latLng.latitude;
        double longitude = latLng.longitude;

        if (boundingBox.getMinLongitude() <= 3 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH && boundingBox.getMaxLongitude() >= 3 * -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH) {
            if (longitude < boundingBox.getMinLongitude()) {
                if (boundingBox.getMinLongitude()
                        - longitude > (longitude + (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)) - boundingBox.getMaxLongitude()) {
                    longitude += (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
                }
            } else if (longitude > boundingBox.getMaxLongitude()) {
                if (longitude - boundingBox.getMaxLongitude() > boundingBox.getMinLongitude()
                        - (longitude - (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH))) {
                    longitude -= (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
                }
            }
        }

        if (latitude < boundingBox.getMinLatitude()) {
            boundingBox.setMinLatitude(latitude);
        }
        if (latitude > boundingBox.getMaxLatitude()) {
            boundingBox.setMaxLatitude(latitude);
        }
        if (longitude < boundingBox.getMinLongitude()) {
            boundingBox.setMinLongitude(longitude);
        }
        if (longitude > boundingBox.getMaxLongitude()) {
            boundingBox.setMaxLongitude(longitude);
        }

    }
503918
public boolean contains(BoundingBox boundingBox) {
		return getMinLongitude() <= boundingBox.getMinLongitude()
				&& getMaxLongitude() >= boundingBox.getMaxLongitude()
				&& getMinLatitude() <= boundingBox.getMinLatitude()
				&& getMaxLatitude() >= boundingBox.getMaxLatitude();
	}
668098
public static GeometryEnvelope buildEnvelope(BoundingBox boundingBox) {
		GeometryEnvelope envelope = new GeometryEnvelope();
		envelope.setMinX(boundingBox.getMinLongitude());
		envelope.setMaxX(boundingBox.getMaxLongitude());
		envelope.setMinY(boundingBox.getMinLatitude());
		envelope.setMaxY(boundingBox.getMaxLatitude());
		return envelope;
	}
1268632
def set_query_latlon(self):
        '''
        
        '''

        if (isinstance(self.longitude, list) and
                isinstance(self.latitude, list)):
            self.lbox = True
            # west, east, south, north
            self.query.lonlat_box(self.longitude[0], self.longitude[1],
                                  self.latitude[0], self.latitude[1])
        else:
            self.lbox = False
            self.query.lonlat_point(self.longitude, self.latitude)
371912
public BoundingBox boundingBoxToWgs84(BoundingBox boundingBox) {
        if (projection == null) {
            throw new GeoPackageException("Shape Converter projection is null");
        }
        return boundingBox.transform(toWgs84);
    }
669570
function _getBoundingBox (result) {
  if (!result.viewport) {
    return;
  }
  const upperLeft = result.viewport.topLeftPoint;
  const bottomRight = result.viewport.btmRightPoint;

  return {
    south: bottomRight.lat,
    west: upperLeft.lon,
    north: upperLeft.lat,
    east: bottomRight.lon
  };
}
399307
public void populateLineString(LineString lineString, List<LatLng> latLngs) {

        for (LatLng latLng : latLngs) {
            Point point = toPoint(latLng, lineString.hasZ(), lineString.hasM());
            lineString.addPoint(point);
        }
    }
710509
private void setRect(double minLat, double minLng, double maxLat, double maxLng)
    {
        if (!(minLat < maxLat))
        {
            throw new IllegalArgumentException("GeoBounds is not valid - minLat must be less that maxLat.");
        }
        if (!(minLng < maxLng))
        {
            if (minLng > 0 && minLng < 180 && maxLng < 0)
            {
                rects = new Rectangle2D[] {
                        // split into two rects e.g. 176.8793 to 180 and -180 to
                        // -175.0104
                        new Rectangle2D.Double(minLng, minLat, 180 - minLng, maxLat - minLat),
                        new Rectangle2D.Double(-180, minLat, maxLng + 180, maxLat - minLat) };
            }
            else
            {
                rects = new Rectangle2D[] { new Rectangle2D.Double(minLng, minLat, maxLng - minLng, maxLat - minLat) };

                throw new IllegalArgumentException("GeoBounds is not valid - minLng must be less that maxLng or "
                        + "minLng must be greater than 0 and maxLng must be less than 0.");
            }
        }
        else
        {
            rects = new Rectangle2D[] { new Rectangle2D.Double(minLng, minLat, maxLng - minLng, maxLat - minLat) };
        }
    }
1061261
function expandYBounds(bounds, value) {
  if (bounds[MIN_Y] > value) bounds[MIN_Y] = value;else if (bounds[MAX_Y] < value) bounds[MAX_Y] = value;
}
485235
public Bbox applyMargins(Bbox bounds) {
		Bbox applied = (Bbox) bounds.clone();
		Coordinate c = getUpperLeftCorner();
		Double x = c.getX();
		Double y = c.getY();
		if (null != group && group instanceof MapAddon && group != this) {
			Coordinate pc = ((MapAddon) group).getUpperLeftCorner();
			x += pc.getX();
			y += pc.getY();
		}
		applied.setX(x + applied.getX());
		applied.setY(y + applied.getY());
		return applied;
	}
1062971
public BoundingBox boundingBoxToWebMercator(BoundingBox boundingBox) {
        if (projection == null) {
            throw new GeoPackageException("Shape Converter projection is null");
        }
        return boundingBox.transform(toWebMercator);
    }
950269
public BoundingBox projectBoundingBox(BoundingBox boundingBox,
			Projection projection) {
		ProjectionTransform projectionTransform = projection
				.getTransformation(getProjection());
		BoundingBox projectedBoundingBox = boundingBox
				.transform(projectionTransform);
		return projectedBoundingBox;
	}
652071
public BoundingBox overlap(BoundingBox boundingBox, boolean allowEmpty) {

		double minLongitude = Math.max(getMinLongitude(),
				boundingBox.getMinLongitude());
		double maxLongitude = Math.min(getMaxLongitude(),
				boundingBox.getMaxLongitude());
		double minLatitude = Math.max(getMinLatitude(),
				boundingBox.getMinLatitude());
		double maxLatitude = Math.min(getMaxLatitude(),
				boundingBox.getMaxLatitude());

		BoundingBox overlap = null;

		if ((minLongitude < maxLongitude && minLatitude < maxLatitude)
				|| (allowEmpty && minLongitude <= maxLongitude && minLatitude <= maxLatitude)) {
			overlap = new BoundingBox(minLongitude, minLatitude, maxLongitude,
					maxLatitude);
		}

		return overlap;
	}
762169
public static function create_from_distance( $latlon, $distance ) {
    if ( ! ( $latlon instanceof LatLon ) ) {
      throw new GeocodingException( '$latlon parameter is not a LatLon object.' );
    }

    if ( ! Utils::validate_distance( $distance ) ) {
      throw new GeocodingException( 'Distance value is invalid: ' . $distance );
    }
    $distance = (string) $distance;

    // Calculate the bounding box on the globe.
    $center = \AnthonyMartin\GeoLocation\GeoLocation::fromDegrees( $latlon->get_lat(), $latlon->get_lon() );
    $bounds = $center->boundingCoordinates( $distance, 'miles' );

    $min = new LatLon( $bounds[0]->getLatitudeInDegrees(), $bounds[0]->getLongitudeInDegrees() );
    $max = new LatLon( $bounds[1]->getLatitudeInDegrees(), $bounds[1]->getLongitudeInDegrees() );

    return new LatLonRange( $min, $max );
  }
241159
public function isInBounds(LatLngBounds $bounds)
    {
        return $this->position instanceof LatLng && $this->position->isInBounds($bounds);
    }
1173725
public BoundingBox extendMeters(int meters) {
        if (meters == 0) {
            return this;
        } else if (meters < 0) {
            throw new IllegalArgumentException("BoundingBox extend operation does not accept negative values");
        }

        double verticalExpansion = LatLongUtils.latitudeDistance(meters);
        double horizontalExpansion = LatLongUtils.longitudeDistance(meters, Math.max(Math.abs(minLatitude), Math.abs(maxLatitude)));

        double minLat = Math.max(MercatorProjection.LATITUDE_MIN, this.minLatitude - verticalExpansion);
        double minLon = Math.max(-180, this.minLongitude - horizontalExpansion);
        double maxLat = Math.min(MercatorProjection.LATITUDE_MAX, this.maxLatitude + verticalExpansion);
        double maxLon = Math.min(180, this.maxLongitude + horizontalExpansion);

        return new BoundingBox(minLat, minLon, maxLat, maxLon);
    }
319298
def get_bounding_box(self):
        
        return (np.min(self.data["longitude"]),
                np.max(self.data["longitude"]),
                np.min(self.data["latitude"]),
                np.max(self.data["latitude"]))