Class Bounds

java.lang.Object
com.luciad.geometries.Geometry
com.luciad.geometries.Bounds
All Implemented Interfaces:
AutoCloseable

public final class Bounds extends Geometry implements AutoCloseable
Represents a bounds.
See Also:
  • Constructor Details Link icon

    • Bounds Link icon

      public Bounds(@NotNull Bounds other)
    • Bounds Link icon

      public Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate location, double width, double height, double depth)
      Creates a new bounds instance based on a point, and the width, height and depth with respect to that point.
      Parameters:
      reference - the coordinate reference
      location - the lower left location of the bounds
      width - the width
      height - the height
      depth - the depth
    • Bounds Link icon

      public Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate lowerLeft, @NotNull Coordinate upperRight)
      Creates a new bounds instance based on lower left and upper right corners.

      This method takes wrap-around the 180° meridian into account when the coordinate reference is geodetic.

      Parameters:
      reference - the coordinate reference
      lowerLeft - the lower left corner of the bounds
      upperRight - the upper right corner of the bounds
  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Geometry
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Geometry
    • getLocation Link icon

      @NotNull public Coordinate getLocation()
      Returns the lower left corner of this bounds instance.
      Returns:
      the lower left corner of this bounds instance.
    • getWidth Link icon

      public double getWidth()
      Returns the width of this bounds instance.
      Returns:
      the width of this bounds instance.
    • getHeight Link icon

      public double getHeight()
      Returns the height of this bounds instance.
      Returns:
      the height of this bounds instance.
    • getDepth Link icon

      public double getDepth()
      Returns the depth of this bounds instance.
      Returns:
      the depth of this bounds instance.
    • getCenter Link icon

      @NotNull public Coordinate getCenter()
      Returns the center of this bounds instance.

      When this bounds uses a geodetic reference, this method normalizes the result.

      Returns:
      the center of this bounds instance.
    • getLowerLeftCorner Link icon

      @NotNull public Coordinate getLowerLeftCorner()
      Returns the lower left corner of this bounds instance.

      When this bounds uses a geodetic reference, this method normalizes the result.

      Returns:
      the lower left corner of this bounds instance.
    • getLowerRightCorner Link icon

      @NotNull public Coordinate getLowerRightCorner()
      Returns the lower right corner of this bounds instance.

      When this bounds uses a geodetic reference, this method normalizes the result.

      Returns:
      the lower right corner of this bounds instance.
    • getUpperLeftCorner Link icon

      @NotNull public Coordinate getUpperLeftCorner()
      Returns the upper left corner of this bounds instance.

      When this bounds uses a geodetic reference, this method normalizes the result.

      Returns:
      the upper left corner of this bounds instance.
    • getUpperRightCorner Link icon

      @NotNull public Coordinate getUpperRightCorner()
      Returns the upper right corner of this bounds instance.

      When this bounds uses a geodetic reference, this method normalizes the result.

      Returns:
      the upper right corner of this bounds instance.
    • boundsUnion Link icon

      @NotNull public static Bounds boundsUnion(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
      Returns the union of the two bounds objects, provided they are defined in the same coordinate reference.
      Parameters:
      bounds1 - the first bounds.
      bounds2 - the second bounds.
      Returns:
      the union of the two bounds objects.
      Throws:
      IllegalArgumentException - if the bounds are not defined in the same coordinate reference.
    • intersection2D Link icon

      @Nullable public static Bounds intersection2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2)
      Returns the intersection of the two given bounds geometries.
      Parameters:
      bounds1 - a bounds instance
      bounds2 - an other bounds instance
      Returns:
      the intersection of the given bounds geometries. If geodetic bounds, the result is normalized.
    • interacts2D Link icon

      public static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException
      Checks of two given bounds geometries have an interaction, only considering x and y values.
      Parameters:
      bounds1 - the first bounds.
      bounds2 - the second bounds.
      eps - a tolerance for the interaction check.
      Returns:
      true if the two bounds interact in 2D.
      Throws:
      IllegalArgumentException - if the bounds are not defined in the same coordinate reference.
    • interacts2D Link icon

      public static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
      Checks of two given bounds geometries have an interaction, only considering x and y values.
      Parameters:
      bounds1 - the first bounds.
      bounds2 - the second bounds.
      Returns:
      true if the two bounds interact in 2D.
      Throws:
      IllegalArgumentException - if the bounds are not defined in the same coordinate reference.
    • contains2D Link icon

      public static boolean contains2D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps)
      Checks if this bounds contains the specified coordinate, considering only the x and y values.
      Returns:
      true if this bounds contains the specified coordinate, considering only the x and y values.
    • contains2D Link icon

      public static boolean contains2D(@NotNull Bounds bounds, @NotNull Coordinate coordinate)
      Checks if this bounds contains the specified coordinate, considering only the x and y values.
      Returns:
      true if this bounds contains the specified coordinate, considering only the x and y values.
    • contains2D Link icon

      public static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException
      Checks if the first bounds contains the second bounds, only considering x and y values.
      Parameters:
      bounds1 - a bounds instance.
      bounds2 - an other bounds instance.
      eps - a tolerance for the contains check.
      Returns:
      if the first bounds contains the second bounds.
      Throws:
      IllegalArgumentException - if the bounds are not defined in the same coordinate reference.
    • contains2D Link icon

      public static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException
      Checks if the first bounds contains the second bounds, only considering x and y values.
      Parameters:
      bounds1 - a bounds instance.
      bounds2 - an other bounds instance.
      Returns:
      if the first bounds contains the second bounds.
      Throws:
      IllegalArgumentException - if the bounds are not defined in the same coordinate reference.
    • contains3D Link icon

      public static boolean contains3D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps)
      Checks if the first bounds contains the second bounds.
      Parameters:
      bounds - a bounds instance.
      coordinate - a coordinate.
      eps - a tolerance for the contains check.
      Returns:
      true if this bounds contains the specified coordinate.
    • contains3D Link icon

      public static boolean contains3D(@NotNull Bounds bounds, @NotNull Coordinate coordinate)
      Checks if the first bounds contains the second bounds.
      Parameters:
      bounds - a bounds instance.
      coordinate - a coordinate.
      Returns:
      true if this bounds contains the specified coordinate.
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object