Class BoundingBox

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

public class BoundingBox extends Object
Bounding box for Geometry or Geography type in the representation of min/max value pairs of coordinates from each axis. A bounding box is considered valid if none of the X / Y dimensions contain NaN.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BoundingBox(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, double mMin, double mMax)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a copy of the current bounding box.
    boolean
     
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
    double
     
    int
     
    boolean
    Checks if the bounding box is empty in the M dimension.
    boolean
    Checks if the M dimension of the bounding box is valid.
    boolean
    Checks if the bounding box is valid.
    boolean
    Checks if the bounding box is empty in the X dimension.
    boolean
    Checks if the X dimension of the bounding box is valid.
    boolean
    Checks if the bounding box is empty in the X / Y dimension.
    boolean
    Checks if the X and Y dimensions of the bounding box are valid.
    boolean
    Checks if the bounding box is empty in the Y dimension.
    boolean
    Checks if the Y dimension of the bounding box is valid.
    boolean
    Checks if the bounding box is empty in the Z dimension.
    boolean
    Checks if the Z dimension of the bounding box is valid.
    void
    Expands this bounding box to include the bounds of another box.
    void
    Resets the bounding box to its initial state.
     
    void
    update(org.locationtech.jts.geom.Geometry geometry)
    Extends this bounding box to include the spatial extent of the provided geometry.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BoundingBox

      public BoundingBox()
    • BoundingBox

      public BoundingBox(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, double mMin, double mMax)
  • Method Details

    • equals

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

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

      public double getXMin()
    • getXMax

      public double getXMax()
    • getYMin

      public double getYMin()
    • getYMax

      public double getYMax()
    • getZMin

      public double getZMin()
    • getZMax

      public double getZMax()
    • getMMin

      public double getMMin()
    • getMMax

      public double getMMax()
    • isValid

      public boolean isValid()
      Checks if the bounding box is valid. A bounding box is considered valid if none of the X / Y dimensions contain NaN.
      Returns:
      true if the bounding box is valid, false otherwise.
    • isXYValid

      public boolean isXYValid()
      Checks if the X and Y dimensions of the bounding box are valid. The X and Y dimensions are considered valid if none of the bounds contain NaN.
      Returns:
      true if the X and Y dimensions are valid, false otherwise.
    • isXValid

      public boolean isXValid()
      Checks if the X dimension of the bounding box is valid. The X dimension is considered valid if neither bound contains NaN.
      Returns:
      true if the X dimension is valid, false otherwise.
    • isYValid

      public boolean isYValid()
      Checks if the Y dimension of the bounding box is valid. The Y dimension is considered valid if neither bound contains NaN.
      Returns:
      true if the Y dimension is valid, false otherwise.
    • isZValid

      public boolean isZValid()
      Checks if the Z dimension of the bounding box is valid. The Z dimension is considered valid if none of the bounds contain NaN.
      Returns:
      true if the Z dimension is valid, false otherwise.
    • isMValid

      public boolean isMValid()
      Checks if the M dimension of the bounding box is valid. The M dimension is considered valid if none of the bounds contain NaN.
      Returns:
      true if the M dimension is valid, false otherwise.
    • isXYEmpty

      public boolean isXYEmpty()
      Checks if the bounding box is empty in the X / Y dimension.
      Returns:
      true if the bounding box is empty, false otherwise.
    • isXEmpty

      public boolean isXEmpty()
      Checks if the bounding box is empty in the X dimension.
      Returns:
      true if the X dimension is empty, false otherwise.
    • isYEmpty

      public boolean isYEmpty()
      Checks if the bounding box is empty in the Y dimension.
      Returns:
      true if the Y dimension is empty, false otherwise.
    • isZEmpty

      public boolean isZEmpty()
      Checks if the bounding box is empty in the Z dimension.
      Returns:
      true if the Z dimension is empty, false otherwise.
    • isMEmpty

      public boolean isMEmpty()
      Checks if the bounding box is empty in the M dimension.
      Returns:
      true if the M dimension is empty, false otherwise.
    • merge

      public void merge(BoundingBox other)
      Expands this bounding box to include the bounds of another box. After merging, this bounding box will contain both its original extent and the extent of the other bounding box.
      Parameters:
      other - the other BoundingBox whose bounds will be merged into this one
    • update

      public void update(org.locationtech.jts.geom.Geometry geometry)
      Extends this bounding box to include the spatial extent of the provided geometry. The bounding box coordinates (min/max values for x, y, z, m) will be adjusted to encompass both the current bounds and the geometry's bounds.
      Parameters:
      geometry - The geometry whose coordinates will be used to update this bounding box. If null or empty, the method returns without making any changes.
    • reset

      public void reset()
      Resets the bounding box to its initial state.
    • copy

      public BoundingBox copy()
      Creates a copy of the current bounding box.
      Returns:
      a new BoundingBox instance with the same values as this one.
    • toString

      public String toString()
      Overrides:
      toString in class Object