Class BoundingBox

java.lang.Object
org.apache.iceberg.geospatial.BoundingBox

public class BoundingBox extends Object
Represents a geospatial bounding box composed of minimum and maximum bounds.

A bounding box (also called a Minimum Bounding Rectangle or MBR) is defined by two points: the minimum and maximum coordinates that define the box's corners. This provides a simple approximation of a more complex geometry for efficient filtering and data skipping.

  • Constructor Details

  • Method Details

    • fromByteBuffers

      public static BoundingBox fromByteBuffers(ByteBuffer min, ByteBuffer max)
      Create a BoundingBox object from buffers containing min and max bounds
      Parameters:
      min - the serialized minimum bound
      max - the serialized maximum bound
      Returns:
      a BoundingBox instance
    • fromByteBuffer

      public static BoundingBox fromByteBuffer(ByteBuffer buffer)
      Deserialize a byte buffer as a BoundingBox object
      Parameters:
      buffer - the serialized bounding box
      Returns:
      a BoundingBox instance
    • toByteBuffer

      public ByteBuffer toByteBuffer()
      Serializes this bounding box to a byte buffer. The serialized byte buffer could be deserialized using fromByteBuffer(ByteBuffer).
      Returns:
      a byte buffer containing the serialized bounding box
    • min

      public GeospatialBound min()
      Get the minimum corner of the bounding box.
      Returns:
      the minimum bound
    • max

      public GeospatialBound max()
      Get the maximum corner of the bounding box.
      Returns:
      the maximum bound
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object